June 10, 2024

Magento 2.4.7: Page Builder was rendering for 5 seconds without releasing locks

Magento 2.4.7 Page Builder Lock Issue: A Case Study

A Frustrating Encounter:

Upgrading to Magento 2.4.7 can be exciting, but for some users, it presented a strange issue with the Page Builder. The problem manifested when editing Page Builder content. After saving the first change, subsequent attempts resulted in an infinite loading screen upon clicking “Save.” No error messages, just a spinning loader – a frustrating experience for any developer.

Troubleshooting Maze:

Our initial troubleshooting efforts covered various avenues. Local development environments didn’t exhibit the issue, suggesting a server-specific problem. We explored JavaScript customization, PHP debugging, and configuration adjustments, but none yielded a solution.

The Glimmer of Hope:

Days of investigation led us to a potential fix on Git. While the patch contained numerous file changes, one specific modification caught our eye.

The Culprit Revealed:

The change resided in the file vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html. Notably, the attribute allow-same-origin was removed from the iframe tag:

				
					- <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>
+ <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts" style="position: absolute; width:0; height:0; border: none;"></iframe>
				
			

The Fix and the Lesson Learned:

We created a patch based on this change and installed it on the server, effectively resolving the issue. The culprit, it seems, was the allow-same-origin attribute previously included in the Page Builder iframe tag.

In Conclusion:

This experience highlights the importance of community resources like Git. It also serves as a reminder that seemingly small changes can have significant impacts. By sharing this case study, we hope to help other Magento developers avoid similar roadblocks.

Author

Share this post:
Facebook
Twitter
LinkedIn
WhatsApp

Discover more articles