Closed (duplicate)
Project:
Experience Builder
Version:
0.x-dev
Component:
Redux-integrated field widgets
Priority:
Critical
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
10 Sep 2024 at 13:01 UTC
Updated:
10 Jul 2025 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
bnjmnmTheres some code formatting needed but it works & the e2e test expanded to include this functionality

Comment #4
bnjmnmComment #5
wim leersComment #6
wim leersRoot cause analysis
For the steps to reproduce in this issue, the small commit I pushed shows that this is a broader problem:
… and if you'd manually fix that, you'd now get:
The
entity_referencefield type does not containsrc,alt,widthnorheightas a field property.It only contains a
target_idproperty (and a computedentityproperty).Possible solutions
StaticPropSourcerepresentation. Given the need for real-time updates of the preview (without relying on communication with the server whenever possible), it's not viable to constantly be submitting the field widget to retrieve the actualStaticPropSourcerepresentation, only to pass that back from the client to the server again to update the preview.prop expression, so … it should be able to unevaluate/reverse the evaluated/resolved props values that the client does know (and needs for real-time preview updates) using that prop expression.That second part is something I have known for a while we'll need to do/resolve. But everything has been "good enough" so far. This is the first issue where that explicitly is being surfaced, so I used the opportunity to dig into this.
Why dig into it now? Because while the fix that @bnjmnm wrote is a fine work-around, it essentially hardcodes the "unevaluating/reversing" of evaluated/resolved props values using the expression for one particular hard-coded expression: the one defined in
media_library_storage_prop_shape_alter().Proposed next steps
\Drupal\experience_builder\PropSource\StaticPropSource::formTemporaryRemoveThisExclamationExclamationExclamation().Comment #7
wim leersRE next steps in #6:
Next: create follow-up issue, link to it, and await review.
Just talked to @tedbow, @longwave and @effulgentsia about this problem space in a meeting, so at least now they're aware that this is something we'll need to figure out 👍 (And it likely will require the data model on the client side to become more complex.)
Comment #8
wim leersFYI: we'll need something like #6 too for allowing, among others:
an SDC will need to be able to define a default image, per #3462705: [META] Missing features in SDC needed for XB
that image will have be a file inside the SDC's directory
… which means that it won't exist as a
Fileor aMediaentity… which means its must be auto-created.
This is exactly why @f.mazeikis in his work on #3463999: Auto-create/update Component config entities for all discovered SDCs that meet XB's minimum criteria exempted any SDC whose
StorablePropShapeended up using an EntityReferenceItem (entity reference field type) or subclass.The infrastructure I PoC'd would allow that to start working, and would allow a default image to be specified by the SDC and correctly tracked in the
Componentconfig entity, when combined with @f.mazeikis' prior work on auto-encoding content entity dependencies into the config entity and auto-restoring upon config import.Comment #10
larowlan@tedbow indicated this as a possible issue to work on for me, so I started with a rebase, looking further into the remaining work next
Comment #11
larowlanIs this still needed in light of discussion in https://docs.google.com/document/d/1sMpbWxnOZM-yq4IbrabUBh7-RGYj_2-aYkBR... and #3467954: META: Evolve XB UI's data model to allow non-SDC components' inputs, DynamicPropSource support, etc. where it looks like we might keep the stored and evaluated state in the FE state?
Comment #12
wim leersMy comment #6 is very closely related to @larowlan's work at #3493943: SDC+JS Component Sources: split default values into `resolved` and `source`.
#11: keeping this open for now, until we resolve the cluster of issues contained/covered by the meta you linked.
Comment #13
wim leersFeels like this … has actually been solved elsewhere in the past few months? 😇🤞
Do you agree, @larowlan?
Comment #14
larowlanRetested the steps in the original issue and this no longer occurs.
We have test coverage for this in media-library-component-instance.cy.js