Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Component sources
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2025 at 10:01 UTC
Updated:
22 May 2025 at 08:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
balintbrewsI started seeing this problem with regular code components as well. Before updating the issue title and summary, can you please confirm, @lauriii? This seems like a regression after
0.2.0-alpha1.Comment #3
wim leersLOL, I independently found the same bug at #3512385-5: Changes to code components are not visible in global regions until published while digging into #3512385: Changes to code components are not visible in global regions until published — they both have the same root cause.Actually, the issue summary is way too ambiguous:
Which preview?
It kinda sounds like it's #1, but then the STR make it sound like it's #3.
If it's #3: does that "block override code component" (which is highly experimental!) happen to be placed in a page region, or in the content entity's XB field? If it's in a page region, this is a duplicate of #3512385: Changes to code components are not visible in global regions until published.
Comment #4
lauriiiIt is number 3, the XB canvas' preview. This is different from #3512385: Changes to code components are not visible in global regions until published because with overrides, the block doesn't have to be placed in a page region for this bug to occur.
Comment #5
wim leersThanks for confirming/clarifying.
The culprit is
\Drupal\experience_builder\Plugin\ExperienceBuilder\ComponentSource\BlockComponent::renderComponent()'s:… because that doesn't perform auto-save checking, because everything that #3505993: Code Components as Block Overrides, step 1 did was a highly experimental hack 😅
Which is why to make this code component auto-save load, we're now needing to modify the
blockComponentSource! 🤪We can hack this further for now, but we really need to work to refactor all the
⚠️ Highly experimentalcomments away: they're there for a reason!Demoting priority, because such experimental features cannot be critical.
Comment #6
wim leersThe fix is:
… except that the
TRUEcannot be hardcoded, but should happen only when appropriate, as described over at #3512385-4: Changes to code components are not visible in global regions until published.IMHO it's fine to hard-code this as-is, which would result in the auto-saved "block override" code component to be visible even OUTSIDE XB's UI. IMHO that's fine because this is a highly experimental feature that needs to be rewritten anyway into its own component source plugin, which means it's a waste of time to work on passing "XB preview or not" context into this. If we can figure it out in <30 mins, we can do that, otherwise should just commit that one-liner IMHO.
Comment #7
wim leersComment #8
tedbowupdating summary to mention xb_dev_js_blocks as I think you need that because you can't make overrides from the UI yet
Comment #9
tedbowworking on this
Comment #11
tedbowI have test coverage that proves the auto-saved version is used in the layout preview but not elsewhere.
I am not sure if the best place for the test coverage but it works
Comment #12
wim leersComment #13
wim leersComment #15
wim leersComment #16
nagwani commentedComment #17
mayur-sose commentedThe issue still persists. I followed the same steps as mentioned in the overview. Please refer to the attached video for a detailed walkthrough of the issue:
https://drive.google.com/file/d/1Tvq2zRr-N6bZYwma8nrFgmjfquoJoBUu/view?u...
Comment #18
wim leers@mayur-sose The video is inaccessible, can you make it publicly available? 🙏
Comment #19
wim leersComment #20
tedbowInvestigating.
@mayur-sose, small point but the video shows the steps in slightly different order than the summary
From the summary
xb_dev_js_blocksas this provide block overrides which you can't make from the UI yetIn the video, step 4, dragging the component on, was done before step 2 and 3, editing the override.
In any case both orders should work.
I tested both orders and they worked for me. I have attached screen recordings.
It very well could be that something in the last 18 days since @mayur-sose posted his screen recording that some other commit fixed this.
@mayur-sose can you test this again with both editing the override and then dragging it on, as the summary says and dragging it on and then editing it.
Thanks
Comment #21
tedbowSince #3508922: Regression after #3500386: import map scope mismatch when previewed code component's JS is a 307 due to it not having an auto-save/draft just landed another merge request I test this again because it does relate to auto-save. Both situations I described in #20 still work
Comment #22
mayur-sose commentedThis issue has been fixed and working as expected. Thanks @tedbow !