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

CommentFileSizeAuthor
#4 drupal-3549491-4.patch3.18 KBgrimreaper

Issue fork drupal-3549491

Command icon 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

grimreaper created an issue. See original summary.

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Active » Needs work
StatusFileSize
new3.18 KB

Patch for Composer usage for Core 10.5.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

grimreaper’s picture

Assigned: Unassigned » grimreaper

sivaji_ganesh_jojodae made their first commit to this issue’s fork.