Problem/Motivation
When using 2 different "sources" of attributes (example: a UIP2 source plugin + UI Styles), the values are not always merged correctly.
Proposed resolution
On UIP2 source plugin: don't send non-empty array value when empty string
On ComponentElementAlter::processAttributesRenderProperty() merge recursive to also merge the HTML classes.
Issue fork ui_patterns-3482208
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 #3
pdureau commentedComment #4
just_like_good_vibesseems nice, but i just wonder if "array_merge_recursive" is really enough to cover all the cases.
Comment #5
pdureau commentedThere are 2 levels in an attribute array:
Example:
12 HTML attributes expects a list as value according to https://html.spec.whatwg.org/#unordered-set-of-unique-space-separated-to...
Set of space-separated tokens:
Unordered set of unique space-separated tokens:
Ordered set of unique space-separated tokens:
Unordered set of unique space-separated tokens, ASCII case-insensitive:
So, because it is a mess, I am proposing to follow what https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Template%... is doing:
See: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...
Comment #6
pdureau commentedComment #8
pdureau commentedComment #9
pdureau commented