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

Magento 2 version 2.4.7-p2 “Page Builder was rendering for 5 seconds without releasing locks” error. #39076

Closed
2 of 5 tasks
sunit9 opened this issue Aug 21, 2024 · 49 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.

Comments

@sunit9
Copy link

sunit9 commented Aug 21, 2024

Preconditions and environment

Magento 2.4.7-p2

Steps to reproduce

  1. Login to magento admin
  2. Content -> Block -> Add new block
  3. Add Block Title
  4. Add Identifier
  5. Click on Save

Expected result

Block should be save successfully.

Actual result

On screen only loader display and in console getting error.
Page Builder was rendering for 5 seconds without releasing locks
2024-08-21_10-22

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Aug 21, 2024

Hi @sunit9. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@Bashev
Copy link
Contributor

Bashev commented Aug 21, 2024

looks like same with this: #37516 and #37798

@sunit9
Copy link
Author

sunit9 commented Aug 21, 2024

I have check in firefox but not working.
My chrome version is Version 127.0.6533.119 (Official Build) (64-bit)
I check same things for 2.4.6-p2 and it's working fine.

@engcom-Bravo engcom-Bravo self-assigned this Aug 21, 2024
Copy link

m2-assistant bot commented Aug 21, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. label Aug 21, 2024
@medigeek
Copy link
Member

medigeek commented Aug 21, 2024

I think your problem is with mageno 2.4 and CORS - apache htaccess or nginx requires some tweaking

Check your browser's javascript console log.

Access to script at 'https://example.com/static/versionXXXXXXXXXX/adminhtml/Magento/backend/en_US/requirejs-config.js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The solution is explained here:
https://magento.stackexchange.com/a/170726

Had the same issue. The above worked for a support case. Hopefully it will work for you too.

From the magento stack exchange:

I faced the same problem with a Magento setup with Nginx.

I share you my working configuration which solve this CORS problem for an headless Magento use case (API).

[...] (don't do the API location /rest as it may break some sites)

Some Allow-Headers is not mandatory, try to test which are on your case.

Then add headers on all other requests :

location ~ (index|get|static|report|404|503)\.php$ {
    .....
    .....

    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,X-CustomHeader,Keep-Alive,User-Agent,Origin,Referer,X-HTTP-Method-Override,X-Accept-Charset,X-Accept,Accept,Access-Control-Request-Method,Access-Control-Request-Headers,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
}

Make sure to keep the always option in order to add these headers for response code other than : 200, 201, 204, 206, 301, 302, 303, 304, 307, or 308

Make sure you do not have basic auth authentication behind. If not, update the configuration in order to allow the OPTIONS CORS request made from your browser.

@engcom-Bravo
Copy link
Contributor

@magento give me 2.4.7-p2 instance

Copy link

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

Copy link

@engcom-Bravo
Copy link
Contributor

@medigeek Thanks for your Contribution!!

Hi @sunit9,

Thanks for your reporting and collaboration.

Could you please refer this comment #39076 (comment). which resolves your issue and please let us know if you are still facing any issue.

Thanks.

@engcom-Bravo engcom-Bravo added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels Aug 22, 2024
@sunit9
Copy link
Author

sunit9 commented Aug 23, 2024

I have change in following file
vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html

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

To

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

In sandbox i append "allow-same-origin"

It works for me. I do not have idea it's good solution or not. If anyone know then please advise.

@chrisoliver90
Copy link

chrisoliver90 commented Aug 23, 2024

Adobe Commerce confirmed this issue on our 2.4.7-p1 install and offered us the following patch that fixed it (ACSD-59582_2.4.7)
Save as ACSD-59582_2.4.7.patch and add to m2-hotfixes directory

diff --git a/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php b/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php
new file mode 100644
index 000000000000..07bd7ca989e6
--- /dev/null
+++ b/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\Backend\ViewModel;
+
+/**
+ * View model interface for requirejs configuration modifier
+ */
+interface RequireJsConfigModifierInterface
+{
+    /**
+     * Modifies requirejs configuration
+     *
+     * @param array $config requirejs configuration
+     * @return array
+     */
+    public function modify(array $config): array;
+}
diff --git a/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml b/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
index 6fa41e107995..1b1a5d7fcaf3 100644
--- a/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
+++ b/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
@@ -5,12 +5,20 @@
  */
 
 /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
+/** @var \Magento\Backend\Block\Page\RequireJs $block */
+
+$requireJsConfig = [
+    'baseUrl' => $block->getViewFileUrl('/'),
+];
+
+$configModifier = $block->getConfigModifier();
+$requireJsConfig = $configModifier instanceof \Magento\Backend\ViewModel\RequireJsConfigModifierInterface
+    ? $configModifier->modify($requireJsConfig)
+    : $requireJsConfig;
 
 $scriptString = '
     var BASE_URL = \'' . /* @noEscape */ $block->getUrl('*') . '\';
     var FORM_KEY = \'' . /* @noEscape */ $block->getFormKey() . '\';
-    var require = {
-        \'baseUrl\': \'' . /* @noEscape */ $block->getViewFileUrl('/') . '\'
-    };';
-
-echo /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false);
+    var require = ' . /* @noEscape */ json_encode($requireJsConfig) .';';
+?>
+<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
diff --git a/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
new file mode 100644
index 000000000..1ae244b03
--- /dev/null
+++ b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\PageBuilder\ViewModel;
+
+use Magento\Backend\ViewModel\RequireJsConfigModifierInterface;
+use Magento\Framework\View\Element\Block\ArgumentInterface;
+
+/**
+ * Modifies requirejs configuration for the stage render frame
+ *
+ * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
+ * as the same origin policy will not allow us to load the templates within this iframe.
+ * It is important that this mapping is configured before requirejs-config.js to ensure the text! plugin is overridden
+ * for all requests.
+ */
+class StageRenderFrameRequireJsConfigModifier implements ArgumentInterface, RequireJsConfigModifierInterface
+{
+    /**
+     * @inheritDoc
+     */
+    public function modify(array $config): array
+    {
+        $config['map']['*'] = array_merge(
+            $config['map']['*'] ?? [],
+            [
+                'text' => 'Magento_PageBuilder/js/master-format/render/requirejs/text',
+                'Magento_PageBuilder/js/events' => 'Magento_PageBuilder/js/master-format/render/events'
+            ]
+        );
+        return $config;
+    }
+}
diff --git a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
index 6a95e8e87..c40005870 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
+++ b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
@@ -14,6 +14,13 @@
         <remove src="css/styles.css"/>
     </head>
     <body>
+        <referenceBlock name="require.js">
+            <arguments>
+                <argument name="config_modifier" xsi:type="object">
+                    Magento\PageBuilder\ViewModel\StageRenderFrameRequireJsConfigModifier
+                </argument>
+            </arguments>
+        </referenceBlock>
         <referenceContainer name="backend.page" remove="true"/>
         <referenceContainer name="menu.wrapper" remove="true"/>
         <referenceContainer name="root">
diff --git a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
index 6e96a2757..2586df2b3 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
+++ b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
@@ -10,33 +10,16 @@
  */
 ?>
 
-<?php
-/**
- * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
- * as the same origin policy will not allow us to load the templates within this iframe.
- */
-?>
 <?php
 $pageBuilderConfig = $block->getPageBuilderConfig();
 
-$script = <<<SCRIPT
-   require.config({
-       'map': {
-           '*': {
-               'text': 'Magento_PageBuilder/js/master-format/render/requirejs/text',
-               'Magento_PageBuilder/js/events': 'Magento_PageBuilder/js/master-format/render/events'
-           }
-       }
-   });
-SCRIPT;
-
 /**
  * To be able to override the text plugin we need the Magento template engine to be used, as the template engine
  * within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
  * dependency blocks us. If we try to just override using the RequireJS config above our !text plugin will never
  * get overridden as our template engine cannot load.
  */
-$script .= <<<SCRIPT
+$script = <<<SCRIPT
     require([
         'ko',
         'Magento_Ui/js/lib/knockout/template/engine'
diff --git a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
index 8b495ce72..1ff74d860 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
@@ -31,6 +31,7 @@
         <with args="stage">
             <render></render>
         </with>
-        <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>
+        <!-- Do not modify the "sandbox" attribute without approval from a security engineer -->
+        <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts" style="position: absolute; width:0; height:0; border: none;"></iframe>
     </if>
 </div>

@hostep
Copy link
Contributor

hostep commented Aug 23, 2024

Adding allow-same-origin is considered a security issue according to the comment in the patch mentioned above. So I wouldn't do that.

Based on the patch above (thanks @chrisoliver90!), here are commits that fix this in Magento OS modules:

@medigeek
Copy link
Member

@hostep I don't understand, was this released with 2.4.7 / 2.4.7-p2 ? Is this patch available somewhere? Is this added to the release notes? AFAICS this affects 2.4.7-p2.

@medigeek
Copy link
Member

OK so I tried out and noticed that the latest versions of backend and page builder modules don't have this code included.

Having another go at this, these are the composer-compatible patches:

fix-backend-error-page-builder-when-editing-cms-block.patch

fix-error-page-builder-when-editing-cms-block.patch

@engcom-Bravo
Copy link
Contributor

@hostep @chrisoliver90 Thanks for your Contribution!!

As per this comment #39076 (comment) we are closing this issue.

Thanks.

@medigeek
Copy link
Member

medigeek commented Aug 26, 2024

@engcom-Bravo was this issue documented in 2.4.7 and 2.4.7-p2 release notes? When can we expect this bugfix issue to be released as a version or an official patch? Thank you.

@sunit9
Copy link
Author

sunit9 commented Aug 26, 2024

Is any one has tried this solution into Magento CE 2.4.7-p2 ? I tired but not working.

@medigeek
Copy link
Member

medigeek commented Aug 26, 2024

@sunit9 it should, as far as I can see the change in code removed the allow-same-origin but didn't include the workaround code in the patch.
After the patch you have to do a full reocmpile/redeploy.
If it doesn't work, check your full javascript logs for maybe some other errors to solve the issue.
Also, if you're using cloudflare, try without the cloudflare proxy.

@hostep
Copy link
Contributor

hostep commented Aug 28, 2024

Magento's quality patches 1.1.50 got released today and also contains patches for this problem for various versions of Magento: magento/quality-patches@e8ad819...d2e5320#diff-5c6d9dd586fe0c5875aa848aad7a1d0729ff28ff44d8bb8d3bec92dfa02f3207R12282-R12311

@sunit9
Copy link
Author

sunit9 commented Aug 28, 2024

@medigeek I got following error in console after apply

fix-backend-error-page-builder-when-editing-cms-block.patch

fix-error-page-builder-when-editing-cms-block.patch

[2024-08-28 02:37:57] [ERROR] Page Builder was rendering for 5 seconds without releasing locks.

image

I am working on my local system. So no cloudflare proxy

@amiyoghoshstar
Copy link

Same happneing with me! Is it related to chrome browser?

@medigeek
Copy link
Member

@sunit9 try reproduce in vanilla magento (clear new installation of magento)

@anjali25021995
Copy link

anjali25021995 commented Aug 28, 2024

@hostep I got following the still we are getting the issue

magento/magento2-page-builder@70634ff
ab5947b

image

Please fix this issue ASAP

@daniel-zaretsky1
Copy link

daniel-zaretsky1 commented Aug 28, 2024

After applying the new patch released ACSD-60169 we are still experiencing this issue in all browsers tested (Chrome/Firefox/Safari). Recompiled we experience that this issue sporadically resurfaces when saving. Sometimes the saves are successful in Firefox, other times we get the [ERROR] Page Builder was rendering for 5 seconds without releasing locks. In almost all cases using chrome it fails. Before our workaround was to just use Firefox to update CMS Blocks/Pages but not anymore since we're experiencing this in it as well now.

@anjali25021995
Copy link

@daniel-zaretsky1 Yes, we are not getting the every time the issue was coming sporadically resurfaces when saving, sometimes the save successful(Chrome/Firefox/), and other times we get the [ERROR] Page Builder was rendering for 5 seconds without releasing locks, permanent fix, can you let us know we are using open source Magento 2,4,7-p2

@medigeek
Copy link
Member

medigeek commented Aug 28, 2024

Not sure if this will help your issue.
It helped us solve some CSP errors.
Try adding something similar to your app/etc/env.php
You probably need to adapt your env.php file per use case (it contains a php array, consult with your developer).
do a full re-deploy/re-compile.

It might be regarded as a security issue, but it will probably make your site work, until you find a more secure long-term solution.

    'system' => [
        'default' => [
            'csp' => [
               'mode' => [
                  'storefront_checkout_index_index' => [
                     'report_only' => '1'
                  ],
                  'admin_sales_order_create_index' => [
                    'report_only' => '1'
                  ]
               ],
               'policies' => [
                  'storefront_checkout_index_index' => [
                    'scripts' => [
                        'inline' => '1'
                    ]
                  ],
                  'admin_sales_order_create_index' => [
                    'scripts' => [
                        'inline' => '1'
                    ]
                  ]
               ]
            ]
        ]
    ]

@anjali25021995
Copy link

Magento 2 version 2.4.7-p2(CE), “Page Builder was rendering for 5 seconds without releasing locks” error. we applied the patch but still got the error ACSD-59582_2.4.7.patch, anyone please provide the solution

@medigeek
Copy link
Member

medigeek commented Aug 28, 2024

did you guys do a composer update ?
which version of composer info -a magento/module-page-builder are you using?
you ought to be using v2.2.5-p2 (marked with an asterisk next to it) with magento 2.4.7-p2

@anjali25021995
Copy link

Yes, we are using composer update, our page builder version is v2.2.5-p2 with magento2.4.7-p2, this page builder version correctly still we are getting the issue "“Page Builder was rendering for 5 seconds without releasing locks”

@medigeek
Copy link
Member

@anjali25021995 try reproduce the issue in plain vanilla magento (default theme and default clean magento installation) if possible.

@sunit9
Copy link
Author

sunit9 commented Aug 30, 2024

@medigeek Not working in vanilla installation. I tried env.php solution also.

@engcom-Bravo Please re-open this issue.

@chrisoliver90
Copy link

chrisoliver90 commented Aug 30, 2024

@medigeek The patch I provided (ACSD-59582_2.4.7) was sent to us directly from Adobe Commerce.
I don't believe a quality patch is in place yet but they replicated the issue and sent us that patch which worked.

@jmonrove
Copy link

This is still an issue

@medigeek
Copy link
Member

@sunit9 try the patch from chris in comment above: #39076 (comment)

@sunit9
Copy link
Author

sunit9 commented Sep 2, 2024

@medigeek this patch looks like. So it may not work.

magento/magento2-page-builder@70634ff
ab5947b

This may work in Adobe commerce but not working in Community Edition. I think need to re-open issue for CE.

@medigeek
Copy link
Member

medigeek commented Sep 2, 2024

@sunit9 you could reopen the issue or open a new issue at page builder: https://github.com/magento/magento2-page-builder/issues
also mention this issue and this discussion ( #39076 )

@Watch3ruk
Copy link

issue is not resolved on MOS .
Could this be reopened please

@daniel-zaretsky1
Copy link

Adobe support recommended us to try another patch: ACSD-48857 this had to do with certain aged pages + blocks not being properly parsed by page builder after an AC version upgrade was performed and revisited. This patch was the solution for us that fixed the issue.

@medigeek
Copy link
Member

medigeek commented Sep 19, 2024

well in our case it returned, the solution was to add the nginx configuration headers as mentioned above: #39076 (comment)

don't add the API-related location /rest { ... } as it may break the site

I added this snippet in PHP entry point for main application
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ { ... }

and in:
location /media/ { ... }
location /static/ { ... }

The snippet:

#Fix CORS and magento page builder issue
#https://github.com/magento/magento2/issues/39076
#https://magento.stackexchange.com/a/170726
    add_header 'Access-Control-Allow-Origin' '*' always;
#add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,X-CustomHeader,Keep-Alive,User-Agent,Origin,Referer,X-HTTP-Method-Override,X-Accept-Charset,X-Accept,Accept,Access-Control-Request-Method,Access-Control-Request-Headers,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;

secure or not, it works. until magento open source provides a proper fix for this.
We don't all have access to ACSD patches unfortunately.

@hostep
Copy link
Contributor

hostep commented Sep 19, 2024

To repeat myself, there are patches included for this in the magento quality patches repository, you can find them in the os and commerce directories.

They are defined like this for various versions of Magento and should be applied to 2 different magento packages:

    "ACSD-59514": {
        "categories": [
            "Admin"
        ],
        "title": "Fixes the issue where forms in the Admin area with Page Builder throw the error \"Page Builder was rendering for 5 seconds without releasing locks.\" in the browser console after submitting the form, and changes can't be saved.",
        "packages": {
            "magento/magento2-base": {
                ">=2.4.4 <2.4.4-p9 || >=2.4.5 <2.4.5-p8 || >=2.4.6 <2.4.6-p6": {
                    "file": "os/ACSD-59514_2.4.4-p8.patch"
                },
                ">=2.4.4-p9 <2.4.5 || >=2.4.5-p8 <2.4.6 || >=2.4.6-p6 <2.4.7": {
                    "file": "os/ACSD-60169_2.4.6-p6.patch"
                },
                ">=2.4.7 <2.4.7-p2": {
                    "file": "os/ACSD-59582_2.4.7.patch"
                }
            },
            "magento/module-page-builder": {
                ">=2.2.2 <2.2.2-p9 || >=2.2.3 <2.2.3-p8 || >=2.2.4 <2.2.4-p6": {
                    "file": "commerce/ACSD-59514_2.2.2-p7.patch"
                },
                ">=2.2.2-p9 <2.2.3 || >=2.2.3-p8 <2.2.4 || >=2.2.4-p6 <2.2.5": {
                    "file": "commerce/ACSD-60169_2.2.4-p6.patch"
                },
                ">=2.2.5 <2.2.5-p2": {
                    "file": "commerce/ACSD-59582_2.2.5.patch"
                }
            }
        }
    },

@medigeek
Copy link
Member

@hostep I admire the commitment but unfortunately for some reason ACSD-59582_2.4.7.patch on 2.4.7-p2 doesn't work when applied (i.e. successfully applied but doesn't fix the issue). The only fix that would work was the nginx in my case. mileage may vary obviously.

@Watch3ruk
Copy link

Watch3ruk commented Oct 23, 2024

fixed this for me : [2.4.7-p2 and 2.4.7-p3 MOS ]
check that around line 78 in .../vendor/magento/module-require-js/Block/Html/Head/Config.php
you have :

    protected function _prepareLayout()
    {
        $after = $this->getInsertAfter() ?: RequireJsConfig::REQUIRE_JS_FILE_NAME;

not

  protected function _prepareLayout()
    {
$after = RequireJsConfig::REQUIRE_JS_FILE_NAME;

@aamoronatti
Copy link

I applied all the patches and It wasn't working for me. I purged cloudflare's cache and the page started saving correctly. Maybe this might help someone.

@vivekmehta17
Copy link

vivekmehta17 commented Oct 29, 2024

Hi All,

Tried solution for above issue on Magento2.4.7-p2 working fine and page builder issue not coming now.

create app/code/Vendor/Module/view/adminhtml/requirejs-config.js
var config = {
map: {
'*': {
'Magento_PageBuilder/template/page-builder.html': 'Vendor_Module/template/page-builder.html'

    },
}

};

app/code/Vendor/Moduleview/adminhtml/web/template/

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

@smartexcan
Copy link

I believe I've found the root of the CORS issue described in #39076 (comment)

Earlier this year, changes were made to the Csp module to add subresource integrity to js files.

While originally intended to only be added for checkout and order payment pages, currently it is applied to the 'requirejs-config.js' file on every page in storefront and adminhtml.

We're currently still using the 2.4.6 release line, and these changes look to have been added in 2.4.6-p6.

I created a small module to fix the issue only on the pagebuilder_stage_render page.
https://github.com/smartexcan/magento2-page-builder-require-js-fix

@hostep
Copy link
Contributor

hostep commented Oct 30, 2024

Thanks for the hint @smartexcan, I'll link to #39250 which is now very closely related to this issue I believe.

@lohoy
Copy link

lohoy commented Nov 7, 2024

Hello,

I have this issue on Magento 2.4.7-p3.

To fix that I applied this patch on requirejs module
ACSD-52041_2.4.6.patch (https://github.com/magento/quality-patches/blob/3dc08f7af47d38494acb750bed18372a1c65e752/patches/os/ACSD-52041_2.4.6.patch#L4)
And this patch on pagebuilder module
magento/magento2-page-builder@70634ff
On the version 2.4.7-p3 the file app/code/Magento/PageBuilder/view/adminhtml/web/template/page-builder.html was change but not the other files.

@chalov-anton
Copy link
Contributor

Still an issue on 2.4.7-p3
I'm unable to save a block with HTML Element added via Page Builder.

Image

@ssx
Copy link
Contributor

ssx commented Feb 20, 2025

Still an issue on 2.4.7-p3 I'm unable to save a block with HTML Element added via Page Builder.

Image

you could possibly try: magento/magento2-page-builder#866 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests