magento2-page-builder
magento2-page-builder copied to clipboard
Ignore styles which no longer apply
Description
When PageBuilder initialises, it moves styles from a

This pull request fixes this bug.
Manual testing scenarios
- Use Magento import tool to set a product description (or other Page Builder-enabled attribute) which contains HTML, including some CSS that does not match any elements. (eg,
<span>Sample text</span><style>#not-found { color: red; }</style>) - Navigate to this product in the admin.
- Witness that Page Builder fails to initialise for this field, and saving the product is impossible (due to a different JavaScript error which stems from the same root cause).
- Apply the changes in this pull request.
- Witness that Page Builder initialises as expected, and it is possible to save the product.
Checklist
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [x] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [x] All automated tests passed successfully (all builds are green)
Resolved issues:
- [x] resolves magento/magento2-page-builder#863: Ignore styles which no longer apply
@magento run all tests
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.
@fredden - can you pull develop branch into your fork's branch and fix a failing static test? After that we should be good to merge this PR!
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 run Functional Tests B2B
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 run Functional Tests B2B
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 run all tests
@magento create issue
@magento run all tests
Hi @fredden,
Thanks for the collaboration & contribution!.
We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.
Manual testing scenarios
- Use Magento import tool to set a product description (or other Page Builder-enabled attribute) which contains HTML, including some CSS that does not match any elements. (eg, Sample text)
- Navigate to this product in the admin.
- Witness that Page Builder fails to initialise for this field, and saving the product is impossible (due to a different JavaScript error which stems from the same root cause).
https://github.com/user-attachments/assets/ae9d8699-b3d0-402c-8953-627ee6d1649d
After importing the product with the description we are able to save the product successfully.
Could you please try to reproduce the issue in Latest 2.4-develop instance and could you please let us know if we are still missing anything.
Thanks.
Hi @fredden,
Thank you for your contribution!
As mentioned here https://github.com/magento/magento2-page-builder/pull/804#issuecomment-2250045772, please have a look and let us know if we are missing anything.
Till then closing this PR. Please feel free to reopen it as you want to update further.
Thank you!