Problem/Motivation
Installing the Navigation module on Drupal 11.0.x branch is throwing the fatal error:
TypeError: Drupal\experience_builder\PropShape\PropShape::resolveSchemaReferences(): Argument #1 ($schema) must be of type array, string given in Drupal\experience_builder\PropShape\PropShape::resolveSchemaReferences() (line 50 of modules/custom/experience_builder/src/PropShape/PropShape.php).
Steps to reproduce
1) Install Drupal from the 11.0.x branch.
2) Go to the extensions page and install the Navigation module.
3) It will throw the fatal error.
Proposed resolution
On debugging, It looked like the issue is related to the component core/modules/navigation/components/toolbar-button/toolbar-button.component.yml
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2024-11-06 at 10.56.19 AM.png | 675.27 KB | kunalkursija |
Issue fork experience_builder-3485820
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 #2
kunalkursija commentedComment #3
cilefen commentedDoes the error occur if you uninstall the custom/experience_builder module that is throwing an exception? Can you provide a stack trace?
I am marking this as needing more steps to reproduce because additional modules are needed for the setup that are not mentioned on the steps.
Comment #4
kunalkursija commented@cilefen - The error does not occur when the experience_builder module is uninstalled. Here is the entire error trace:
Comment #5
lauriiiMoving to the Experience Builder queue since this seems like a problem most likely related to it.
Comment #6
lauriiiThis seems related to #3467870: Support `{type: array, …}` prop shapes. I wonder if we should add a new requirement for components; i.e. to not have
type: arrayproperties?This is also pointing another problem; we need a way for components to indicate if the component should be available for Experience Builder. I would not expect anyone to ever want to use the "Toolbar button" component in Experience Builder.
Comment #7
wim leersEmphasis mine.
This is a contradiction with earlier statements you made? 😅
You specifically said that SDCs should not in any way have to be changed. But you did quality that with "changed for use in XB, which specifically is NOT the case here.
So: this is possible. What do you envision the DX for that to be like from a Product POV?
Comment #9
wim leersNo; that
can'tshouldn't 😅 be the reason: XB literally won't try creating an XBComponentconfig entity when it encounters a prop shape it doesn't know how to support.The stack trace (THANK YOU, @kunalkursija! 🤩) points to
::resolveSchemaReferences(). I bet this is simply a bug in there, which is a necessary processing step before the decision is made to create an XBComponentconfig entity or not!I actually ran into this ~2 months ago while working with the folks who were developing https://www.drupal.org/project/demo_design_system for #3454094: Milestone 0.1.0: Experience Builder Demo. Then they moved away from
type: arrayaltogether and hence the problem disappeared. Many urgent things happened, and I failed to create a new issue 🙈MR created with what I think fixes it, @kunalkursija, can you test again? 😊
Comment #10
kunalkursija commented@wim leers - I will test it today & share how it goes.
Comment #11
kunalkursija commented@wim leers - The fatal error did not occur after applying the patch.
Testing Steps Performed:
The patch looks good. Thanks @wim leers for the quick fix :)
Comment #12
wim leersA simple hardening for a few LoC IMHO should not have to wait >24 hours. It's already been five days since #9, and >36 hours since #11.
Comment #14
wim leers@lauriii Back to you because #7 still needs to be answered by you, and merits an explicit issue 🙏
Comment #15
wim leers@tedbow's comment on the MR is a correct interpretation of what the bugfix is that landed here 👍🤓
It's not a fix specific to the Navigation module's SDCs, it's a generic bugfix, that https://www.drupal.org/project/demo_design_system also ran into!
Comment #16
dunx commentedI don't know if this is of any more use or just noise, but I had the same error on enabling XB 0.1.0-alpha1 on Drupal CMS. That Drupal CMS build was based on https://git.drupalcode.org/api/v4/projects/157093/jobs/3432366/artifacts... and I hadn't installed anything else or made any other config changes.
Stack trace slightly different.
Comment #17
dunx commentedSite is now dead. Can't
drush pmuas gettingexperience_builder: The <em class="placeholder">Experience Builder</em> field type is used in the following field: node.field_xb_demo. I'll reload from scratch.Comment #18
wim leers@dunx in #16:
0.1.0-alpha1was just a snapshot in time. It gets zero updates. This bug was fixed in the0.xbranch and will ship only in0.2.0-alpha1in a few months — no other releases will happen.If you want to test XB in its current shape, you must install
0.x-dev😊Comment #19
kristen polHmm... just got this but I'm using 0.x. I'll see if I can figure it out.
UPDATE: Ignore... for some reason, head was detached, just like mine, so all sorted.
Comment #20
dzinkevich commentedI had the same issue as @dunx - I followed the composer instructions on the project page:
composer require 'drupal/experience_builder:^0.1@alpha'Having the same issue with a broken install that I can't revert from.
I know it's in the works but it would be great if this 0.2@alpha could get released soon so others don't have this gotcha.
Comment #21
wim leershttps://www.drupal.org/project/experience_builder/releases/0.2.0-alpha1 is out. You still need to follow the instructions in
CONTRIBUTING.mdthough. #3510892: Allow XB to be gradually adopted: make XB's viewing (formatter) and editing (`ApiLayoutController::get()`) work with an empty XB field will ease that 👍I haven't gotten a response to #7 from @lauriii in almost 4 months. I don't want to keep this issue open any longer. I'll ping him one more time and he can then remove the tags when he answers it. 👍
Comment #22
lauriiiSorry for dropping the ball here. What I was thinking in #6 was providing a new property for SDCs to opt-out from XB, e.g.,
hideFromUi: true. This would allow indicating that a specific component never makes sense to be displayed in XB. Because this is opt-out, this doesn't go against the original principle in my mind.Comment #23
penyaskitoCreated #3513078: Provide an opt-out for hiding a SDC component from XB for following-up on Lauri's proposal.