Quantcast
Channel: Issues for Drupal core
Viewing all 293317 articles
Browse latest View live

[PP-1] #states attribute does not work on #type datetime

$
0
0

Problem/Motivation

#states do not work with 'datetime' form elements:

  • Toggling visibility of the form element fails since there's no wrapper container to target.
  • Trying to toggle disabled fails since we can't find the nested form elements to disable.
  • Trying to toggle "required" fails since we can't find the label to add the right class(es) to.
  • ...

Proposed resolution

Remaining tasks

  1. Land #3078334: Datetime and Datelist elements should render as fieldsets
  2. Write and verify automated tests. Complete. See comments #91-102
  3. Update code and tests once #3078334 is in
  4. Markup review of all the changes to the datetime-wrapper twig templates:
    • System module's default temple - Fixed, but needs final approval.
    • Classy - Decided to leave broken. See #122.
    • Stable - Decided to leave broken. See #122.
    • Bartik - Fixed in #136 - can we do this?
    • Seven - Fixed in #136 - can we do this?
    • Claro - Fixed in #136 - can we do this? Yes. From #admin-ui Slack meeting 2019-11-06: @lauriii "We can make changes to Claro 🎉"
  5. JavaScript review of the changes to core/misc/states.es6.js.
  6. Other reviews + manual testing (optional).
  7. Decide if we can backport to 8.7.x (if so, working patch in #139).
  8. RTBC
  9. Commit.
  10. Unblock child issues.

User interface changes

#states actually works on datetime form elements.

Changes to the datetime-wrapper.html.twig templates (default templates from system and both the classy and stable themes) to:

  • Actually include a wrapper div (!)
  • Always use <label> not <h4> for the label. The label is generated using the existing core theme templates for form labels (form_element_label). (Now the responsibility of #3078334.

API changes

None.

Data model changes

None.

Original Report

While trying to create a custom field widget containing a "datetime" form element, I discovered that the #states attribute does not work on it.

Some states can be achieved with a workaround: put the datetime element in a container, and put the #states on the container. But this is obviously no clean fix, and it doesn't work for all states. (Works for "visible" for example, but not for "required".)

I was not able to figure out why this is not working, but I noticed that there have been a lot of issues regarding the #states attribute in the issue tracker. Most of them for were for specific elements like submit buttons, select elements with multiple values, ...


Views entity operations lack cacheability support, resulting in incorrect dropbuttons

$
0
0

Problem/Motivation

In order to be able to cache the rendered output of views result rows, we need support for it when we render entity operation links, see the https://qa.drupal.org/pifr/test/1022293 test failure.

Steps to reproduce

  • I added a new content type.
  • Role X has "edit own" permissions for this content type, but no other node permissions except view published content.
  • User A and User B both have Role X.
  • Admin user creates two nodes of the new content type, and makes User A the author of one node, and User B the author of the other node.
  • View is created to display all nodes of the new content type; the view includes the Operations Links field.
  • When Admin is logged in, the operations links (Edit, Delete) are available in the view for both nodes (which is the expected behavior).
  • User A logs in, and the Edit link is available in the view only for the node that has User A as author (which is the expected behavior).
  • User B logs in, and the Edit link is available in the view only for the node that has User A as author, when it should be for User B as author.

Taken from #2653690: Operations links field in Views fails between users with "edit own" user permissions

Proposed resolution

Add an access key to each entity operation which contains an AccessResult object to determine whether the user has access to the operation. Use this to apply access to the rendered link, and bubble cacheability from the AccessResult object to the link.

Remaining tasks

Patch review

[policy, no patch] Clarify the policy around backporting changes with potential issues

$
0
0

Problem/Motivation

There are a couple unwritten rules around how to make a patch for the current minor version, for example use underscores for method names.

Proposed resolution

  • Use underscores in front on new method names to avoid conflicts ...
  • Try to always make the least amount of changes
  • meh

Remaining tasks

User interface changes

API changes

Data model changes

Move forum related logic from taxonomy migrations to new forum migrations

$
0
0

Problem/Motivation

Follow-up to two Forum related issues

Clean Forum specific logic from Term migrations

From comment #56:

Separately, it feels super grody to the max and decidedly un-tubular and non-radical to shove a bunch forum logic in the taxonomy term migrations. Maybe we could also get a non-critical follow-up to make Forum a sub-class of Term so we can better encapsulate the one-off logic here.

And comment #59:

I'm wondering if the forum migration could be a secondary migration (i.e. allow taxonomy to migrate the terms, then have forum get the forum/container metadata from the source site, load the terms already migrated and save the field values etc.).

Clean Forum specific logic from Vocabulary migrations

From comment #18

We should open a follow-up to move this logic into a Forum-specific variant of this plugin. Forum could even swap in its own implementation of the plugin (using the ol' plugin hijacking technique) which implements this logic.

And comment #13

Move the process plugin from Taxonomy to Forum.
Set the forum_vocabulary source property somewhere other than the d6_taxonomy_vocabulary and d7_taxonomy_vocabulary source plugins. I am not sure what the best way is, but we must have an event or an alter hook that lets us modify a row.
Implement hook_migration_plugins_alter() to insert the process plugin into 6 migrations, and remove the corresponding step from those migrations.

I am not sure it is worth the effort, but it would have the effect of simplifying the code that is left behind when we remove the Forum module.

Similar: the code related to the is_container source property (set in the d7_taxonomy_term and d7_taxonomy_term_entity_translation source plugins) and the forum_container taxonomy field (boolean?) should be moved to the Forum module

Steps to reproduce

Proposed resolution

Remaining tasks

Discuss

User interface changes

API changes

Data model changes

Release notes snippet

[meeting] Migrate Meeting 2023-06-15 1400Z

$
0
0

Hello all, it’s time for the biweekly migration subsystem meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for core migrate maintainers and developers and anybody else in the community with an interest in migrations
➤ Usually happens every second Thursday and alternates between 1400 and 2100 UTC.
➤ Is done on the #migration channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤*Transcript will be exported and posted* to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Core migration issues

Next video meeting 2023-07-27 2100Z (tentative)

0️⃣ Who is here today?

mikelutz (he/him)Hello
Dan DavisPresent - I am a newcomer to the migration group. Long time user, working on finding ways to contribute.
StephanieHi - also looking to be contributing more

1️⃣ What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.

mikelutz (he/him)#3247718: Allow process plugins to flag a row to be skipped

2️⃣ Action items. To be added later.

benjifisherReview #3007709: Add XPath-style filtering ability in JSON data parser plugin. @benjifisher
benjifisherReview #3063856: Expose full set of debugging data in migrate_message table (filterable/searchable). @benjifisher
benjifisherAdd some documentation for #3358569: Change plugin class for comment/user migration to the standard migration plugin class. @mikelutz (he/him)
benjifisherReview #3247718: Allow process plugins to flag a row to be skipped. @benjifisher

3️⃣ Statistics

benjifisherFixed in the last 2 weeks: 1 (not counting issues for meetings). Another 2 in the previous two weeks.
benjifisherRTBC: 3, all Normal priority, 1 has not been updated in more than 1 month.
benjifisherNR: 1, including 1 Major.
benjifisherNeeds subsystem maintainer review: 8
benjifisherGoogle sheet for recording stats: https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...

4️⃣ Comment in this thread if you are looking for ways to contribute. Give us some idea of what you would like to do: documentation, code review, testing, project management, ...

Dan DavisDocumentation, code review, testing for me.
benjifisher@Dan Davis:  Are you interested in working on the issue in 9️⃣?
Dan DavisReviewing now

5️⃣ Previous minutes.

benjifisherWe skipped the 2023-06-01 meeting. Previous meetings have transcripts and are Closed (fixed). The latest was 2023-05-18: #3360195: [meeting] Migrate Meeting 2023-05-18 1400Z.

6️⃣ Announcements

benjifisherDrupal 7 EOL is set for 2025-01-05, and there will be no more extensions.

The DA is working on a partner program for those who provide migration services. It is still in the early stages. For example, when asked about whether individual contractors can apply for the program, Tim Lehnen said they should think about it.

https://www.drupal.org/psa-2023-06-07

7️⃣ Consolidate code in the migrate_drupal module.

mikelutz (he/him)Had a number of discussions regarding this and the future of migrate in Drupal core with the committers at DrupalCon.
mikelutz (he/him)There isn’t a lot of consensus on how to proceed yet.  One option discussed is to deprecate the d7/d6 stuff in Drupal 11 and NOT move it to contrib, in which case we don’t want to do the work to consolidate everything.  We are going to have further dscussions at the next video meeting and the committers are going to have further disucssions as well.  We probably want to postpone the issues here until those discussions are completed.
mikelutz (he/him)We should definitly add it to the agenda for the next video meeting, (scheduled for July 27th atm). We should invite committers to join that meeting, Gabor/Nat/Jess and/or Alex if he’s back from holiday.
mikelutz (he/him)And lets keep bringing it up in this meeting too.  Everybody is busy with 10.1 right now, but if we don’t keep pressing for a decision, It’s going to slip through the cracks.
mikelutz (he/him)And we want to have a decision by the end of the summer as it will dictate what we can or can’t do in 10.2 to prepare.
heddnhmm, I like deprecate and remove in d12. less busy work.
benjifisherThe 21:00 UTC meetings conflict with the biweekly triage meeting for the security team. We may want to reschedule.

8️⃣ Add XPath-style filtering ability in JSON data parser plugin

benjifisher#3007709: Add XPath-style filtering ability in JSON data parser plugin
benjifisher@Stephanie did some manual testing last week during DrupalCon. It still needs code review. If I do a review and decide it needs some minor changes, is anyone available to make the updates?
StephanieI should have bandwidth for that.

9️⃣ Expose full set of debugging data in migrate_message table (filterable/searchable)

benjifisher#3063856: Expose full set of debugging data in migrate_message table (filterable/searchable)
benjifisherThis issue is now un-postponed since #3312733: SQL migrations cannot be instantiated if database is not available and Node, Migrate Drupal modules are enabled was Fixed a few days ago.
benjifisherCan someone check whether the patch in #141 still applies? When it was posted, it failed static analysis:
Running PHPStan on *all* files.
 ------ -------------------------------------------------------------------------------------- 
  Line   core/modules/migrate_drupal_ui/tests/src/Functional/MigrateMessageControllerTest.php  
 ------ -------------------------------------------------------------------------------------- 
  49     Missing call to parent::setUp() method.                                               
 ------ --------------------------------------------------------------------------------------

That should be pretty easy to fix.

benjifisherI set the status to RTBC in #138, but @alexpott asked for changes in #139. Someone should confirm that the patch in #141 implements those changes.
benjifisherWhy did I set the status to RTBC before #3312733 was Fixed? It was fixed, but then it was reverted because tests failed with SQLite. It is now re-Fixed.

1️⃣0️⃣ Change plugin class for comment/user migration to the standard migration plugin class

benjifisher#3358569: Change plugin class for comment/user migration to the standard migration plugin class
mikelutz (he/him)This one has been coming up more and more in slack lately, where people can’t figure out why their custom processes don’t work in comment and user migrations, and it’s generally traced back to using the core migrations as a starting point, which use a custom migration class to dynamically inject processes.
benjifisher@mikelutz (he/him): This one is for you!

I think we skipped the 2023-06-02 meeting. You left a note on the issue for the previous meeting:

Reminder for myself to discuss #3358569: Change plugin class for comment/user migration to the standard migration plugin class at this meeting. It's been coming up a lot in slack lately, and I think we need to at least improve documentation around the issue.

mikelutz (he/him)I don’t think there is anything to do in core, but I’m thinking we can add some stuff in migrate_upgrade to adjust those migrations on export so people are starting with a more standard starting point.  At minimum we need to probably document this somewhere along with the migrate_plus/migrate_upgrade workflow as it’s a common thing that’s overlooked.
benjifisherMake that the 2023-06-01 meeting (off by a day). I will re-purpose that issue for today's meeting.
mikelutz (he/him)hmm, I don’t recall intentionally skipping that meeting, but I was on vacation that week, I may not have seen the reminder for it and forgot about it. My bad.
mikelutz (he/him)Given attendence at the later meeting lately, I’m guessing no one noticed, lol.
benjifisherMaybe this is a good page to add some documentaiton: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-6-or-...
mikelutz (he/him)My calendar has been messed up since we dropped to every two weeks too, I’ve fixed it but that one may not have been on my calendar.
mikelutz (he/him)Anyway, either document or fix migrate_upgrade to adjust those on export.  but changing the export is probably tricky to do in general, and things like user_profile might make it tough.  There’s also #3005718: D7 comment migration does not properly migrate fields by comment bundle.
mikelutz (he/him)Maybe comments should be bundled after all and not use a custom class anyway.
mikelutz (he/him)Oh.. I made that issue. huh.
benjifisherDon't you love your past self? :wink:
mikelutz (he/him)Am I right, are comments bundlable in d7, but we just try to migrate everything in one go?  I feel like I remember seeing that 5 years ago, but haven’t given it much thought since then.  I haven’t really migrated many sites with comments in my recent career.
benjifisherI do not know.

1️⃣1️⃣ Allow process plugins to flag a row to be skipped (edited) 

benjifisher#3247718: Allow process plugins to flag a row to be skipped
benjifisherI owe you a re-review of that one.

1️⃣2️⃣ Wrap up

benjifisherThanks for participating! I will update 2️⃣. Please continue to add comments in the threads. In 1-7 days, we will post a transcript for today's meeting.
benjifisherIt is great to see some more participation in today's meeting! I have to get to my day job now, but I will add action items later, and maybe even work on the ones assigned to me.
Dan DavisThank you @benjifisher!

Participants:

Notice: Undefined index: value in Drupal\views\Plugin\views\filter\NumericFilter->acceptExposedInput()

$
0
0

Problem/Motivation

Numeric views filter (\Drupal\views\Plugin\views\filter\NumericFilter) and all child filters (Date, SearchApiDate, etc) throw a php notice when using grouped exposed filters with a group identifier that doesn't match the filter identifier.

Notice: Undefined index: value in Drupal\views\Plugin\views\filter\NumericFilter->acceptExposedInput()

Since PHP 8 this is upgraded to an error:

TypeError: Cannot access offset of type string on string in Drupal\views\Plugin\views\filter\Date->acceptExposedInput()

Steps to reproduce

(require updates)

  1. Install Drupal standard profile
  2. Edit the default Content view at /admin/structure/views/view/content
  3. Add a "Changed" filter
  4. Select "Expose this filter to visitors, to allow them to change it"
  5. Select "Grouped filters"
  6. Change the "Filter identifier" value from "changed" to "date"
  7. Set the Grouping 1 label to "Last week", operator to "Is greater than", value type to "An offset from ..." and value "-7 days"
  8. Press Apply and then Save
  9. Navigate to /admin/content
  10. Set the "Changed" filter to "Last week" and press "Filter".

Proposed resolution

Update \Drupal\views\Plugin\views\filter\NumericFilter::acceptExposedInput to target the exposed group identifier as per patch in #48.

Remaining tasks

  1. Add an automated test;

[Meta, Plan] Pitch-Burgh: JSON field storage & JSON field schema support

$
0
0

Problem/Motivation

This is the meta-issue for fulfillment of deliverables for the winning "Pitch-Burgh" proposal shown here. It will be updated as subtasks are identified/completed.

Remaining tasks

[Ignore] In space (and/or this issue), no one can hear patches scream VII


Make field selection less overwhelming by introducing groups

$
0
0

Problem/Motivation

On the first iteration of the prototype from https://www.drupal.org/project/drupal/issues/3343940, we noticed that the way that we chose to represent the available field types was overwhelming. One of the ideas we had was to try to come up with a better grouping of the field types, to hide some of the complexity.

Proposed resolution

Group fields together to make it less overwhelming based on the findings from https://www.drupal.org/project/drupal/issues/3346539#comment-14999770

Remaining tasks

User interface changes

Fields

"Subfields"

API changes

Release notes snippet

Make Description Field Labels Consistent

$
0
0

Problem/Motivation

The label for Descriptions fields are not consistent throughout the UI.

Page URL Description Field Label
Add comment type /admin/structure/comment/types/add Description
Add content type /admin/structure/types/add Description
Add media type /admin/structure/media/add Description
Add menu/admin/structure/menu/addAdministrative summary
Add vocabulary /admin/structure/taxonomy/add Description
Add view /admin/structure/views/add Description
Add custom block/block/addBlock description

Proposed resolution

Change the Description field label at /admin/structure/menu/add to 'Description'
Change the Description field label at Add custom block to 'Description'

Add separate 'Save' and 'Save and add fields' to Add Content, Comment, Media and Block Type Forms

$
0
0

Problem/Motivation

When creating a new Content type, the button text is: 'Save and manage fields'
When creating a new Comment, Media or Block types, the button text is: 'Save'

Page URL Button Text Action after saving
Add content type /admin/structure/types/add Save and manage fields Directs to manage fields page
Add comment type /admin/structure/comment/types/add Save Direct to Comment types overview page
Add media type /admin/structure/media/add Save Directs to Media types overview page
Add custom block type /admin/structure/block/block-content/types/add Save Directs to Block types overview page

Proposed resolution

Proposing that we have two separate buttons on each entity type add form:
#1 'Save', which directs users back to the entity type overview page
'#2 Save and add fields', which directs to the Manage fields page

Page URL Button 1 Text Button 1 Action Button 2 Text Button 2 Action
Add content type /admin/structure/types/add Save Directs to Content types overview page Save and manage fields Directs to manage fields page
Add comment type /admin/structure/comment/types/add Save Directs to Comment types overview page Save and manage fields Directs to manage fields page
Add media type /admin/structure/media/add Save Directs to Media types overview page Save and manage fields Directs to manage fields page
Add custom block type /admin/structure/block/block-content/types/add Save Directs to Block types overview page Save and manage fields Directs to manage fields page

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Blog with now wrong EOL D7

$
0
0

Problem/Motivation

On https://www.drupal.org/blog/drupal-10-0-0 it states that "Drupal 7 support was extended until November 1, 2023, [...]". This is now incorrect and should be 5 jan 2025 (as per https://www.drupal.org/psa-2023-06-07 ). Now I know that the content type is a blog and therefor the content might be out of date, but it doesnt feel like a blog, more a newswire. So could we please change the eol date of d7 to reflect the current changes?

Proposed resolution

change eol d7 date.

Merge Help Topics classes into Help with BC layer

$
0
0

Problem/Motivation

As part of the final merge of Help Topics into Help
#3037230: Finalize the merge of Help Topics into Help
once it is stable, we need to move all of the classes that are currently in Help Topics module into the Help module, leaving behind a BC layer (except for test classes, which do not need to support BC).

Proposed resolution

- move classes, config and topics
- update hooks (install schema and fix config) & test
- disable help_topics if enabled (debatable)

Remaining tasks

- discuss transition
- finish patch
- review/commit

User interface changes

- Help topics available in Help module

API changes

- TBD

Data model changes

- new table help_search_items

Release notes snippet

The Experimental Help Topics module has moved to stable and been subsumed by the existing Help module. An update path will uninstall the help topics module and leave behind an empty shell. The Help Topics module should no longer be used, the functionality has been moved to the existing Help module.

Refactor (if feasible) use of jquery is function to use vanillaJS

$
0
0

Problem/Motivation

As mentioned in the parent issue #3238306: [META] Where possible, refactor existing jQuery uses to vanillaJS to reduce jQuery footprint, we are working towards reducing our jQuery footprint. One of the ways to accomplish this is to reduce the number of jQuery features used in Drupal core. We have added eslint rules that identify specific features and fail tests when those features are in use.

There are (or will be) individual issues for each jQuery-use eslint rule. This one is specific to jquery/no-is, which targets the jQuery is function.

Steps to reproduce

Proposed resolution

Remaining tasks

  • In core/.eslintrc.jquery.json Change "jquery/no-is": 0, to "jquery/no-is": 2, to enable eslint checks for uses of jQuery css(). With this change, you'll be able to see uses of the undesirable jQuery feature by running yarn lint:core-js-passing from the core directory
  • Add the following lines to core/scripts/dev/commit-code-check.sh so the DrupalCI testing script can catch this jQuery usage on all files, not just those which have changed
    # @todo Remove the next chunk of lines before committing. This script only lints
    #  JavaScript files that have changed, so we add this to check all files for
    #  jQuery-specific lint errors.
    cd "$TOP_LEVEL/core"
    node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json .
    
    CORRECTJQS=$?
    if [ "$CORRECTJQS" -ne "0" ]; then
      # No need to write any output the node command will do this for us.
      printf "${red}FAILURE ${reset}: unsupported jQuery usage. See errors above."
      STATUS=1
      FINAL_STATUS=1
    fi
    cd $TOP_LEVEL
    # @todo end lines to remove

    Add the block about 10 lines before the end of the file, just before if [[ "$FINAL_STATUS" == "1" ]] && [[ "$DRUPALCI" == "1" ]]; then, then remove it once all the jQuery uses have been refactored.

  • If it's determined to be feasible, refactor those uses of jQuery is() to use Vanilla (native) JavaScript instead.

User interface changes

API changes

Data model changes

Release notes snippet

Refactor (if feasible) uses of the jQuery css function to use Vanilla/native

$
0
0

Problem/Motivation

As mentioned in the parent issue #3238306: [META] Where possible, refactor existing jQuery uses to vanillaJS to reduce jQuery footprint, we are working towards reducing our jQuery footprint. One of the ways to accomplish this is to reduce the number of jQuery features used in Drupal core. We have added eslint rules that identify specific features and fail tests when those features are in use.

There are (or will be) individual issues for each jQuery-use eslint rule. This one is specific to jquery/no-css, which targets the jQuery css function.

Steps to reproduce

Proposed resolution

Remaining tasks

  • In core/.eslintrc.jquery.json Change "jquery/no-css": 0, to "jquery/no-css": 2, to enable eslint checks for uses of jQuery css(). With this change, you'll be able to see uses of the undesirable jQuery feature by running yarn lint:core-js-passing from the core directory
  • Add the following lines to core/scripts/dev/commit-code-check.sh so the DrupalCI testing script can catch this jQuery usage on all files, not just those which have changed
    # @todo Remove the next chunk of lines before committing. This script only lints
    #  JavaScript files that have changed, so we add this to check all files for
    #  jQuery-specific lint errors.
    cd "$TOP_LEVEL/core"
    node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json .
    
    CORRECTJQS=$?
    if [ "$CORRECTJQS" -ne "0" ]; then
      # No need to write any output the node command will do this for us.
      printf "${red}FAILURE ${reset}: unsupported jQuery usage. See errors above."
      STATUS=1
      FINAL_STATUS=1
    fi
    cd $TOP_LEVEL
    # @todo end lines to remove

    Add the block about 10 lines before the end of the file, just before if [[ "$FINAL_STATUS" == "1" ]] && [[ "$DRUPALCI" == "1" ]]; then, then remove it once all the jQuery uses have been refactored.

  • If it's determined to be feasible, refactor those uses of jQuery css() to use Vanilla (native) JavaScript instead.

User interface changes

API changes

Data model changes

Release notes snippet


FieldableEntityInterface: When implementing this interface which extends Traversable...

$
0
0

Problem/Motivation

Drupal\Core\Entity\ContentEntityInterface says in the docs:

When implementing this interface which extends Traversable, make sure to list
IteratorAggregate or Iterator before this interface in the implements clause.

Drupal\Core\Entity\FieldableEntityInterface has the same doc section.

However FieldableEntityInterface does not seems to extend \Traversable so either (1) it should, or (2) this code section should be removed.

This change seems as old as issue #2275659 Perhaps a copy and paste error?. https://www.drupal.org/project/drupal/issues/2275659#comment-8857705

Proposed resolution

Remove this doc from FieldableEntityInterface since it only applies to ContentEntityInterface.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

[Random test failure] Random failure in CKEditor5AllowedTagsTest::testMediaElementAllowedTags

$
0
0

Problem/Motivation

From the eternal random failure gold mine that is the qa runs (https://www.drupal.org/node/3060/qa):

There was 1 error:

1) Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testMediaElementAllowedTags
Behat\Mink\Exception\ElementNotFoundException: Form field with id|name|label|value "filters[media_embed][settings][allowed_view_modes][view_mode_2]" not found.

/var/www/html/vendor/behat/mink/src/Element/TraversableElement.php:207
/var/www/html/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php:386
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

https://www.drupal.org/pift-ci-job/2696423

Steps to reproduce

This one had me searching for a while...

Over here I took a screenshot and dumped the HTML when the ElementNotFoundException is thrown.

The screenshot shows that view_mode_2 is actually not present, there's no AJAXing going on, and the page looks (and turns out to be) completely loaded:
CLUNK
(HTML as txt-file is here)

As it turns out, we start the test by going to the 'admin/config/content/formats/add' page in \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5TestBase::createNewTextFormat, do some stuff and then create two new EntityViewModes.

This can be appearantly to slow for the page to pick up on it, or at least sometimes to pick up on the last of the two, which then does not get displayed when we enable the embed media option.

Proposed resolution

Move the creation of the two new EntityViewModes to the front of the test.

Also, as already said in #7, the waitForField without checking its output is basically a convuloted way to add a sleep.

We remove it, replace it with a $assert_session->assertWaitOnAjaxRequest(), since the line before it ($page->clickLink('Embed media')) triggers an AJAX request.

Finally we remove the $assert_session->assertWaitOnAjaxRequest() below the two checkFields in line 387-388, since they don't trigger any AJAX request and waiting on that is useless.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Refactor transactions

$
0
0

Problem/Motivation

The code managing database transaction is very complex - part of it sits in the Connection class, part of it in the Transaction class, and there's back and forth of calls between the two objects.

This makes hard to implement transaction management in contrib database drivers if they need to deviate from the core implementation. Also when looking at #3348590: Add transaction-related events to the Database API, it's complicated to find the right places to dispatch events.

Proposed resolution

Disentangle the transaction management code, introducing a transaction manager that does all the client operations and deals with the calls stack; reduce code in Connection and Transaction to a minimum i.e. calls to the manager's methods.

In the course of that, fix #3074033: Add a test for Connection::addRootTransactionEndCallback

Deprecate something (???)

Remaining tasks

Review by committers if something we want.
Identify if anything needs to be deprecated.
Change Record
Final Review

User interface changes

NA

API changes

TODO

Data model changes

TODO

Release notes snippet

TODO

Test issue please ignore

Add config validation for the allowed characters of machine names

$
0
0

Problem/Motivation

Config entities require validation for REST support. Add a generic "machine_name" type and validate the value.

Proposed resolution

Add type: machine_name with validation constraints — with both the regex and length overridable to allow non-standard machine name shapes.

Impact as measured by #3324984: Create test that reports % of config entity types (and config schema types) that is validatable's ConfigSchemaValidatabilityTest (and diff before124.txt after124.txt):

Config entity types
  • ⏸️ 0.00% → 0.00% validatable (0 of 30 config types — excludes base types)
  • 🆙 24.16% → 31.24% average config type validatability
  • 🆙 36.10% → 39.35% validatable property paths (200 → 218 of 554 property paths — this excludes property paths for base types)
Config types
  • 🆙 4.61% → 4.76% validatable (29 → 30 of 629 → 630 config types — excludes base types)
  • 🆙 25.95% → 26.40% average config type validatability
  • 🆙 36.80% → 37.29% validatable property paths (1392 → 1411 of 3783 → 3784 property paths — this excludes property paths for base types)

Remaining tasks

None.

User interface changes

None.

API changes

API addition: machine_name config schema data type

Data model changes

None.

Viewing all 293317 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>