[ignore] Bubble render contexts from current to parent

Created on 3 May 2024, 4 months ago
Updated 8 July 2024, 2 months ago

Problem/Motivation

I found that a form with a submit button having #ajax settings, when served via AJAX, got the add_js lines for attached libraries in reverse order compared to the order in which form elements are rendered. With careful debugging, I concluded it's a side effect of how RenderContext::bubble() merges parent into current.

A quick manual change showed that changing the merging order to merging current into parent does result in the add_js lines to reflect the order in which form elements are rendered in the template. My gut tells me Drupal core will break somewhere else by applying such change, but I'm curious to see how much breakage that is.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Asset library 

Last updated 1 day ago

No maintainer
Created by

🇨🇴Colombia jedihe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jedihe
  • Pipeline finished with Failed
    4 months ago
    Total: 544s
    #162993
  • 🇨🇴Colombia jedihe

    Found a strange error in MachineNameTest, which doesn't reproduce in my local site (tried it in the add content type screen).

    Status    Group      Filename          Line Function                            
    --------------------------------------------------------------------------------
    Fail      Other      phpunit-77.xml       0 Drupal\FunctionalJavascriptTests\Co
        PHPUnit Test failed to complete; Error: PHPUnit 9.6.15 by Sebastian
        Bergmann and contributors.
        
        Testing Drupal\FunctionalJavascriptTests\Core\MachineNameTest
        F                                                                   1 / 1
        (100%)
        
        Time: 00:21.484, Memory: 4.00 MB
        
        There was 1 failure:
        
        1) Drupal\FunctionalJavascriptTests\Core\MachineNameTest::testMachineName
        JavaScript condition met:
        jQuery("#edit-name-machine-name-suffix .machine-name-value").html() ==
        "test_1"
        Failed asserting that false is true.
        
        /builds/issue/drupal-3444995/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
        /builds/issue/drupal-3444995/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
        /builds/issue/drupal-3444995/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:171
        /builds/issue/drupal-3444995/core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php:199
        /builds/issue/drupal-3444995/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
  • Pipeline finished with Failed
    4 months ago
    Total: 574s
    #163013
  • 🇳🇿New Zealand quietone New Zealand

    This looks like an individual testing issue. Therefore I am updating the metadata per special issue titles guidelines . And moving to 11.x, which is the main development branch, where fixes are applied first.

Production build 0.71.5 2024