magento / magento2-page-builder

Magento2 PageBuilder
Other
81 stars 63 forks source link

Ensure children do not become orphans #813

Closed fredden closed 3 months ago

fredden commented 2 years ago

Description

There is a bug in PageBuilder where child content nodes are going missing. These exist and work just fine when the content is first created, and saved, and shows correctly on the front-end. However, when the form is re-rendered in the admin, the children have been deleted, so saving the page/content a second time deletes these content nodes.

This is because the list of child nodes is replaced rather than added to when walking the node tree.

Manual testing scenarios

  1. Create a new content type with a master template which has several siblings HTML nodes. For example,
<section class="pagebuilder-windmill" attr="data.main.attributes" ko-style="data.main.style" css="data.main.css">
  <div class="wrapper">
    <render args="masterTemplate" ></render>
  </div>

  <div class="pagination" if="data.main.attributes()['data-show-dots']"></div>

  <if args="data.main.attributes()['data-show-arrows']">
    <div class="button-prev"></div>
    <div class="button-next"></div>
  </if>

  <div class="scrollbar" if="data.main.attributes()['data-show-scrollbar']"></div>
</section>
  1. Create a new Page in the admin and use this new content type.
  2. Populate the content type with some child nodes (which will show up in the preview & on the front-end where we have the <render /> tag)
  3. Save (and close) the page in the admin.
  4. Check all is well on the front-end.
  5. Click "edit" the same page in the admin, make no changes, click "save".
  6. Observe the content has been erased by viewing the front-end and/or the admin.

Checklist

hc-sven commented 1 year ago

When will this be merged? This is a real issue. I can confirm that this change fixes the problem!

(We added a module to overwrite the stage-builder.js file for now)

paras89 commented 1 year ago

@magento run all tests

magento-automated-testing[bot] commented 1 year ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

magento-automated-testing[bot] commented 1 year ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

engcom-Hotel commented 9 months ago

@magento run all tests

engcom-Hotel commented 9 months ago

@magento run Functional Tests EE, WebAPI Tests

engcom-Hotel commented 8 months ago

@magento run all tests

engcom-Hotel commented 7 months ago

@magento run WebAPI Tests, Unit Tests, Performance Acceptance Tests, Integration Tests, Functional Tests EE, Functional Tests CE, Functional Tests B2B

engcom-Hotel commented 6 months ago

Hello @fredden,

We have tried to reproduce the issue in the latest development branch ie 2.4-develop but it seems the issue is not reproducible for us.

For reference, we are attaching the custom module through which we have tried to reproduce the issue: Magz.zip

Let us know if we missed anything.

Thanks

engcom-Hotel commented 6 months ago

Hello @fredden,

Have you got a chance to check the above comment?

Thanks

fredden commented 6 months ago

@engcom-Hotel I have seen your request. I have not yet found time to review this in detail. I will respond here when I've done so. I know that we had this problem on the latest version of this module on a website recently, and applying these proposed changes resolved the issue.

engcom-Hotel commented 4 months ago

Hello @fredden,

Have you got a chance to check this PR? Actually, according to this https://github.com/magento/magento2-page-builder/pull/813#issuecomment-2102250485, we are not able to reproduce the issue.

Thanks

engcom-Hotel commented 3 months ago

Hello @fredden,

We have noticed that this PR has not been updated for a period of long time. Hence we are closing this PR for now.

Let us know when you are ready to work on it again, and we will be happy to re-open it. Thank you for your contribution!

fredden commented 3 months ago

It hasn't been updated as there's nothing here that needs to be changed.

engcom-Hotel commented 3 months ago

Hello @fredden,

We have attempted to reproduce the issue, but we were unable to do so. Consequently, we left a comment here: https://github.com/magento/magento2-page-builder/pull/813#issuecomment-2102250485 with the module attached for reference.

In your comment here: https://github.com/magento/magento2-page-builder/pull/813#issuecomment-2114126747, you mentioned that you would check this issue. However, we have not received any further updates from you for a significant amount of time. As a result, we have closed the PR.

Please let us know if you are still able to reproduce the issue, and we will be happy to reopen it.

Thanks!

fredden commented 2 months ago

It's curious that Adobe takes two years to respond (and this is a "good" response; I've personally seen much longer waiting periods), but closes pull requests where the contributor doesn't respond within two weeks.

I'm no longer looking into this. Others are welcome to pick up these changes and help Adobe recognise the bug that this fixes.