-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix #866: Add element existence check to prevent Page Builder editor crashes #873
base: develop
Are you sure you want to change the base?
Fix #866: Add element existence check to prevent Page Builder editor crashes #873
Conversation
@magento run all tests |
300cae8
to
fab562f
Compare
fab562f
to
c5287ab
Compare
c5287ab
to
67be2a5
Compare
Encountered a scenario where missing HTML elements in Page Builder caused runtime errors due to direct calls to setAttribute. Added an existence check before setting attributes to avoid breaking the editor. This ensures continued functionality and improves stability by handling cases where elements are not found. Logically, the core should include such checks to enhance resilience and user experience.
67be2a5
to
d4dc67c
Compare
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing it internally, it was found that the automated test is not required for this change. Hence moving it to ready for testing. Thanks |
Hello @artttj, Thanks for the contribution! ❌ QA not Passed We have tried to reproduce the actual issue in the 2.4-develop branch with pagebuilder's develop branch, but the issue is not reproducible for us. Please refer to the below screencast for reference: Screen.Recording.2024-10-25.at.5.mp4Let us know if we missed anything. Thanks |
Description
We encountered a scenario where missing HTML elements in Page Builder led to runtime errors due to direct calls to
setAttribute
.To address this, we added an existence check before setting attributes. This change prevents the editor from breaking and improves stability by handling cases where elements are missing.
Ideally, the core should include such checks to enhance overall resilience and user experience.
Story
N/A
Bug
N/A
Task
N/A
Fixed Issues
Builds
N/A
Related Pull Requests
N/A
Manual Testing Scenarios
Please test the following scenarios to verify the changes:
Remove
data-pb-style
Attribute:data-pb-style
attribute from an element with applied styles.Modify
data-pb-style
Hash:data-pb-style
attribute's value to a non-relevant hash.Remove HTML Element:
Note: This issue was observed when using the DeepL API, but similar problems might occur in other scenarios. The preview editor should remain stable.
Questions or comments
N/A
Checklist