magento2
magento2 copied to clipboard
Block preview in page builder broken for blocks that do not belong in the default strore.
Preconditions and environment
Magento ver. 2.4.3-p2
Steps to reproduce
- Have a magento instance with at least two stores
- Create a cms block only visible in the store that is not the default store
- Create a cms page in on of the two stores (doesn't matter which one)
- Add the cms block you created, in the page through the page builder.
Expected result
Block preview should render
Actual result
No block preview is rendered

Additional information
From my research, i found that the code goes through this file vendor/magento/module-cms/Block/Widget/Block.php(131) and gets sets the default store id on the block it's trying to fetch. It then tries to look for the block from the other store with the wrong store id, and does not find it here vendor/magento/module-cms/Model/ResourceModel/Block.php(121). The block is not loaded and the preview is blank.
Note that only the preview in the page builder is broken, the page renders correctly on the frontend.
Release note
No response
Triage and priority
- [X] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @TheBadong. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me 2.4-develop instance
Hi @TheBadong. Thank you for your request. I'm working on Magento instance for you.
Hi @TheBadong, here is your Magento Instance: https://fde56b008b77c88efc9ac1348a092fde.instances.magento-community.engineering Admin access: https://fde56b008b77c88efc9ac1348a092fde.instances.magento-community.engineering/admin_7ba5 Login: a3a7275d Password: 2e76b7ced467
Just tested and reproduced on this instance

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself. -
[ ] 3. Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmedonce verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, here is your Magento Instance: https://fde56b008b77c88efc9ac1348a092fde.instances.magento-community.engineering Admin access: https://fde56b008b77c88efc9ac1348a092fde.instances.magento-community.engineering/admin_8f39 Login: 8a5519f9 Password: 843138d415f4
Verified the issue on Magento 2.4-develop instance and is reproducible. Hence confirming this issue.

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6968 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@magento I am working on this
The problem comes from the way the block is loaded:
- pagebuilder do an ajax call to https://your.magento.com/admin/pagebuilder/stage/preview/key/
/?isAjax=true with a payload containing the block_id (there is no store_id in it) - in \Magento\PageBuilder\Model\Stage\Preview::startPreviewMode, it loads the block using the default store of your environnement regardless the attached website
But how to do it properly ? If your cms page is in 2 different websites and the block_id referers 2 different blocks (one on each website) : which one to display to render it in admin ?
@Dnd-Mafer rendering a block by ID should always be possible since that's a unique key. Using an identifier is different, that identifier can be used for different stores (can't overlap).
I can't reproduce this issue at the moment, although we have several other issues with previews of CMS blocks not working, this ain't one.
Update: I was wrong. Apparently one of the default storeviews was selected, I thought you referred to selecting "all store views".
How come this issue is still in the backlog? The entire multi language store view setup is borked with CMS blocks on several points.
- the inability to select a CMS block based on an identifier instead of a block id. When you have a store independent CMS page but you insert a store specific CMS block with the pagebuilder component, that's a no go because it only saves the ID. Same with the widget through Text Component but at least you can change the block id there to a identifier through the html code view (although the html code view was enabled by us in our own module...)
- the inability to preview CMS blocks selected by id's not on the default store view like in this case.
Content is such a big deal right now that we're having a hard time explaining our clients to just duplicate the CMS pages in this case just to make this work.
Hi @TheBadong,
Thanks for your reporting and collaboration.
We have tried to reproduce the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
No block preview is rendered
Hence Confirming the issue.
Thanks.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6968
Hello,
For information, here is the response received from Adobe Commerce Core Team through Adobe Enterprise support... :
Not a Bug
because
Preview of CMS pages/blocks works only on default store view because those entities don't support the scope (there is no store view switcher like on Dynamic Blocks or Products).