Problem/Motivation
The component library in UI Patterns breaks when this module is installed.
The menu-tree has required props menus and exclude, but UI Patterns Library doesn't provide a default for them, and ComponentValidator->validateProps() throws an error.
Steps to reproduce
Enable Menu Trees and UI Patterns Library.
Go to the component library.
See whitescreen errors.
Proposed resolution
Add default values of empty array/string.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Screenshot From 2026-08-13 09-20-49.png | 59.85 KB | peter törnstrand |
Issue fork menu_tree-3616164
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
mortona2k commentedI see that an example has been added for those props, but that doesn't work with the component library.
Comment #5
peter törnstrand commentedTry it out now @mortona2k
Comment #6
mortona2k commentedUI Patterns Library is working. It only renders the Main menu label, since there are no default links specified.
SDC Styleguide isn't working, but that's due to an error in how it handles complex properties. It's trying to put them in a text area.
I added a related issue for that.
This is a case where the UI Patterns Library can't really provide a better demo from default values because we don't want to provide irrelevant dummy content as the default. It makes more sense to do that as a story.
In the patch, you have main:standard.front_page as an example link. This is only in the standard install profile and may not exist. Maybe use links from system instead?
SDC Styleguide can create demos with a drush command. That sounds a lot closer to what is needed to set up realistic styleguides
Comment #7
mortona2k commentedI think it should be examples, not example?
Looks like some modules like SDC Styleguide, SDC Component Library are using examples.
Comment #8
peter törnstrand commentedI'm not sure what you mean by:
I have never used the module and I'm not sure what to expect. It does not crash the site at least :-)
Comment #9
mortona2k commentedNow it doesn't work in SDC Styleguide... Looks like a bug on their end though.
Comment #10
peter törnstrand commentedOk, I will review the fix. Can we consider this done then?
Comment #11
mortona2k commentedYes sounds good.
Comment #14
peter törnstrand commentedThank you. Included in release 2.1.2.