Problem/Motivation
In ComponentNegotiator::maybeNegotiateByTheme method, the detection is based on the active theme.
This does not handle the case you have code executed in admin theme context but wanting to negociate definition for a component in the default theme.
For example: An allowed_values_function callback with
$button = \Drupal::service('plugin.manager.sdc')->negotiateDefinition('ui_suite_bootstrap:button');
Steps to reproduce
Proposed resolution
Instead of themeManager it should be the themeHandler service that should be used.
I will propose a first fix to target default theme, but the logic should be reworked to detect if the replaced component is in admin theme hierarchy or default theme hierarchy.
Remaining tasks
- rework detection logic
- write tests
User interface changes
None
Introduced terminology
None
API changes
Different service injected for Component Negociator.
Data model changes
None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drupal-3549491-4.patch | 3.18 KB | grimreaper |
Issue fork drupal-3549491
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
grimreaperPatch for Composer usage for Core 10.5.
Comment #6
grimreaper