Problem/Motivation
With UI Icons Patterns, having a node with a field type icon, when trying to add 'Data from a field' to slot an error occur and to a prop no source is available.
Steps to reproduce
First problem, Icon field as a slot source
I have a component with a slot and a prop type icon, example here.
I have a node content with an Icon field.
Using UI Patterns Field Formatters.
- On the node display, I pick my component on a field as 'Component per item'
- Select the slot > Data from a field
- Pick the Icon field
- Console error:
Warning: Undefined array key 'sources' in Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->getSourcePlugins() (line 131)
Second problem, Icon field source for a prop type icon
- On the node display, I pick my component on a field as 'Component per item'
- select the prop > Source > Data from a field
- Not available
For this one I guess the problem could be on the IconPropType.php missing something. Any review on that appreciated.
Proposed resolution
I have a quick fix for the first problem, but not sure it's ok, to review.
Issue fork ui_patterns-3491536
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
mogtofu33 commentedComment #5
just_like_good_vibeshello, i will take this one with you
Comment #6
just_like_good_vibeshello, the change proposed is messing up something in the DerivableContextSourceBase,
but the solution is elsewhere.
drupal config required for slots and props is not the same.
for a prop, we have like:
for slots, it is slightly different :
if i am not mistaken, the correction you have posted in the MR is not required.
i am now investigating the rest to help you make it work for ui_icons :)
Comment #7
just_like_good_vibesComment #8
mogtofu33 commentedComment #9
mogtofu33 commentedGood for me.
Comment #11
just_like_good_vibesComment #12
pdureau commentedComment #13
pdureau commented