Fixed
Project:
UI Styles
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2026 at 09:56 UTC
Updated:
27 Jul 2026 at 14:57 UTC
Jump to comment: Most recent
Inspired from what Display Builder does in https://git.drupalcode.org/project/display_builder/-/blob/1.0.x/src/Plug...
protected function useAttributesVariable(array $renderable): bool {
$random = \uniqid();
$renderable['#attributes'][$random] = $random;
$html = $this->renderer->renderInIsolation($renderable);
return \str_contains((string) $html, $random);
}
It should be possible to test when drilling if attributes is used or not with this logic.
It should simplify:
- src/Render/Element.php::isRenderElementAcceptingAttributes
- src/Render/Element.php::isThemeHookAcceptingAttributes
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 #2
grimreaperComment #4
grimreaperOne question if you are ok.
Comment #5
pdureau commentedComment #7
grimreaper