Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure children do not become orphans #813

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

fredden
Copy link
Member

@fredden fredden commented Jul 8, 2022

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

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@hc-sven
Copy link

hc-sven commented Jan 19, 2023

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
Copy link
Contributor

paras89 commented Jan 19, 2023

@magento run all tests

@magento-automated-testing
Copy link

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
Copy link

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
Copy link
Collaborator

@magento run all tests

@engcom-Hotel engcom-Hotel self-requested a review February 12, 2024 13:59
@engcom-Hotel engcom-Hotel added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Feb 12, 2024
@engcom-Hotel engcom-Hotel moved this from Ready for Review to Review in Progress in Pull Request Progress Feb 12, 2024
Copy link
Collaborator

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @fredden,

Thanks for the collaboration!

The Changes seem good to me but can you please cover the changes with some automated tests?

Thanks

@engcom-Hotel
Copy link
Collaborator

@magento run Functional Tests EE, WebAPI Tests

@engcom-Hotel
Copy link
Collaborator

@magento run all tests

@engcom-Hotel
Copy link
Collaborator

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

@engcom-Hotel
Copy link
Collaborator

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

@m2-community-project m2-community-project bot moved this from Reviewer Approved to Changes Requested in Pull Request Progress May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Fisheye partners-contribution Progress: changes requested Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Pull Request Progress
  
Changes Requested
Development

Successfully merging this pull request may close these issues.

None yet

5 participants