magento / magento2-page-builder

Magento2 PageBuilder
Other
81 stars 63 forks source link

Broken CMS block preview when using identifier in pagebuilder #812

Open rvr-robert opened 2 years ago

rvr-robert commented 2 years ago

Description (*)

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.

Bug

Fixed Issues (if relevant)

  1. magento/magento2#35070: Broken CMS block preview when using identifier in pagebuilder

Manual testing scenarios (*)

  1. Create a CMS Block with any content
  2. Create a CMS Page and add previously created CMS Block in the page with the PageBuilder Block component
  3. Open cms_page table
  4. Find the created page
  5. Replace block_id value with the block identifier in the content cell. Example for a block with identifier contact-us-banner :
  6. {{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="contact-us-banner" type_name="CMS Static Block"}}
  7. Apply changes
  8. Refresh pagebuilder page to see error

Checklist

rvr-robert commented 2 years ago

@magento run all test

magento-automated-testing[bot] commented 2 years ago

Failed to run the builds. Please try to re-run them later.

engcom-Hotel commented 10 months ago

@magento run all tests

magento-automated-testing[bot] commented 10 months ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

engcom-Hotel commented 1 week ago

@magento run all tests

engcom-Hotel commented 1 day ago

Hello @rvr-robert @jeremycharron,

Thanks for the contribution!

Can you please help us understand the need to update the database in order to reproduce the issue? I think this is not the correct way to produce an issue. Can we reproduce the issue without this?

Thanks

jeremycharron commented 1 day ago

Hello @rvr-robert @jeremycharron,

Thanks for the contribution!

Can you please help us understand the need to update the database in order to reproduce the issue? I think this is not the correct way to produce an issue. Can we reproduce the issue without this?

Thanks

Hi @engcom-Hotel The real concern would be when you are creating a CMS block and assigning it to a page programmatically (in a data patch for example). You'd want the created page to use the same block identifier on every environment the patch is ran. Editing the database directly is just a quick way to replicate the issue without writing a fictional data patch.

Thanks

engcom-Hotel commented 18 hours ago

@magento run all tests