Open jeremycharron opened 2 years ago
Hi @jeremycharron. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
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
Hi @engcom-Delta. 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 label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced 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: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @jeremycharron , Thank your for reporting an issue . Kindly elaborate more on step#5 .How can we test it please? Added the label 'Needs update'.
Hi @jeremycharron , Thank your for reporting an issue . Kindly elaborate more on step#5 .How can we test it please? Added the label 'Needs update'.
Hi @engcom-Delta ,
If step 1 to 4 are done, you should have a new row in the cms_page
table for your created page.
You need to edit the value in the content
cell.
Let's say the content looks like this :
<div data-content-type="block" data-appearance="default" data-element="main">{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="20" type_name="CMS Static Block"}}</div>
You need to change the block_id
parameter to the identifier of your block, which you can find in cms_block
table :
<div data-content-type="block" data-appearance="default" data-element="main">{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="contact-us-banner" type_name="CMS Static Block"}}</div>
Then save the content in the database and refresh pagebuilder to see error described in my initial post. Let me know if you need any other info
Thank you!
Hi @jeremycharron , Thank you for your quick reply. We tried to reproduce the issue on Magento 2.4-develop branch but the issue is not reproducible.
Steps performed:
Create a CMS Block with any content
Create a CMS Page and add previously created CMS Block in the page.
Open cms_page table 4 .Find the created page
Replace block_id value with the block identifier in the content cell.
Apply changes
Refresh pagebuilder page to see error
Result: The pagebuilder should be able to display a preview of the block content
Please let me know if this is exactly what your issue was or if there is some more configuration required from my end. Will update accordingly.
thanks
Hello @engcom-Delta
I was not specific enough : You need to use the Pagebuilder Block Content component.
The legacy Static Block Widget doesn't have a preview, this one is working fine.
I will update the steps to reproduce. Thanks!
After changing to block identifier :
Hi @jeremycharron ,
We tried to reproduce the issue with the above mentioned step but not able to reprouce it, as shown in the screenshot
can you plz tell us the use case of Replace block_id value with the block identifier in the content cell.
Hello @engcom-Delta ,
I'm not sure to understand the screenshot you sent. It looks like a text component. Try removing everything and put a block component directly at the root of pagebuilder. An empty block component should look like this :
The content of the page in the database should be very similar to this:
<div data-content-type="block" data-appearance="default" data-element="main">{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="20" type_name="CMS Static Block"}}</div>
Then change the block id to the block identifier.
The use case is for data installation scripts. Let's say you need to create a data patch that generates a CMS page containing specific CMS blocks, you need the use the identifier as a unique key. The feature already works, it's only the preview in the pagebuilder that is broken.
Hi @jeremycharron , We tried to reproduce the issue on Magento 2.4 Develop but we could not reproduce the issue . Hence , It would be great help if you can make a video for reproducing it.
Test results :
Hello @engcom-Delta ,
Here's a video with steps to reproduce. Thank you.
Hi @jeremycharron , Thank you for providing the recorded video . After following the steps found that issue is reproducible on Magento 2.4 Develop. After updating the block id ,cms page is showing "Block-With ID test-block does not exist". Hence issue is confirming. Screenshots for reference.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2838 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, 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
Hi @rvr-robert! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @rvr-robert! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
@magento I am working on this
Are there any plans to build another page builder entity that DOES use the identifier to embed a block? How would one go about extending this entity to use the identifier rater than the hard block_id?
I am trying to modify it now but am getting stuck where the dialog closes and hands over the ID to the preview. I can't seem to locate how to pass back the identifier and not the block_id for the template substitution.
Summary
When adding a CMS block in a CMS page using the block identifier instead of the block ID, pagebuilder displays following error : "Block with ID: [block identifier] doesn't exist." instead of showing preview of the CMS block.
The block renders properly on front-end. There is no way to add a block with his identifier directly from pagebuilder. This issue would only happen if a developer executes a data patch that generates CMS content or directly edit the content in the database.
Preconditions (*)
Steps to reproduce (*)
cms_page
tableblock_id
value with the block identifier in thecontent
cell. Example for a block with identifiercontact-us-banner
:<div data-content-type="block" data-appearance="default" data-element="main">{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="contact-us-banner" type_name="CMS Static Block"}}</div>
Expected result (*)
Ability to load block by identifier was added back in 2017 https://github.com/magento/magento2/issues/10414
From what I'm seeing in the following file,
getBlockId
function should handle non-numeric IDs (identifiers) : https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Cms/Model/ResourceModel/Block.phpActual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.