YAML discovery does not take theme inheritance into account

Created on 28 June 2024, 4 days ago

Problem/Motivation

This problem occurs for plugin types with YAML discovery.

In Core, there is layout.

In contrib, at least the following modules have the problem in their plugin types:

Steps to reproduce

Have two themes, one is a parent, the other is a child.

Ensure the machine name of the child is alphabetically before the machine name of the parent.

Declare a layout in the parent theme.
Override the layout in the child theme.

Result: the plugin is not overridden.

Proposed resolution

Remaining tasks

Found a solution.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

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

Merge Requests

Comments & Activities

  • Issue created by @Grimreaper
  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·
  • Issue was unassigned.
  • Status changed to Needs work 4 days ago
  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    Provided a MR with a failing test to demonstrate the problem.

  • Pipeline finished with Failed
    4 days ago
    Total: 177s
    #210930
  • Pipeline finished with Failed
    4 days ago
    #210951
  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    https://git.drupalcode.org/issue/drupal-3457863/-/jobs/1984798#L4263

    ---- Drupal\KernelTests\Core\Layout\LayoutPluginManagerTest ----
    Status    Group      Filename          Line Function                            
    --------------------------------------------------------------------------------
    Fail      Other      phpunit-361.xml      0 Drupal\KernelTests\Core\Layout\Layo
        PHPUnit Test failed to complete; Error: PHPUnit 10.5.20 by Sebastian
        Bergmann and contributors.
        
        Runtime:       PHP 8.3.8
        Configuration: /builds/issue/drupal-3457863/core/phpunit.xml.dist
        
        F                                                                   1 / 1
        (100%)
        
        Time: 00:01.315, Memory: 8.00 MB
        
        There was 1 failure:
        
        1)
        Drupal\KernelTests\Core\Layout\LayoutPluginManagerTest::testPluginOverride
        Failed asserting that two strings are identical.
        --- Expected
        +++ Actual
        @@ @@
        -'Child'
        +'Parent'
        
        /builds/issue/drupal-3457863/core/tests/Drupal/KernelTests/Core/Layout/LayoutPluginManagerTest.php:40
    
Production build 0.69.0 2024