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

CMS Block content is not updated according to page builder changes during CMS Block save #37514

Closed
1 of 5 tasks
Aleksejs-Prjahins opened this issue May 18, 2023 · 33 comments
Closed
1 of 5 tasks
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: Content Component: PageBuilder Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@Aleksejs-Prjahins
Copy link

Preconditions and environment

  • Magento 2.4.4, Commerce
  • CMS Block with a lot of content

Steps to reproduce

  1. Navigate to the admin panel
  2. Content -> Blocks -> Select block
  3. Make block changes
  4. Click on Save

Expected result

CMS Block content is saved and a success message appears.

Actual result

A success message appears, but CMS Block content stays as it was before.

Screen.Recording.2023-05-18.at.17.09.59-1.mov

Additional information

During investigation been found that when the save button was clicked content of the page builder which was transported to the hidden input field is old.
Also, the issue appears randomly, sometimes content is saved, sometimes not.

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”.
@m2-assistant
Copy link

m2-assistant bot commented May 18, 2023

Hi @Aleksejs-Prjahins. 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.

@m2-assistant
Copy link

m2-assistant bot commented May 18, 2023

Hi @engcom-November. 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-November
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@frostitution
Copy link

Probably related to #34898 - I have a similar issue, it only happens on Chrome. Try FireFox or other browsers

@engcom-November
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-November
Copy link
Contributor

Hi @Aleksejs-Prjahins ,
Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance but the issue is not reproducible.
CMS Block content is getting updated as expected after editing and saving with Page builder.
But the block preview is not working properly (HTML code content is not displayed properly) and this bug being tracked in a separate bug: #36713
Unable to access the video attached in the description. Kindly recheck the issue on Magento 2.4-develop instance and provide missing steps if any if the issue is still reproducible.

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label May 19, 2023
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 19, 2023
@engcom-November engcom-November added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label May 19, 2023
@denissdubinin
Copy link

I have same issue on Magento 2.4.6

@KrzysztofWisniewskiAcc
Copy link

KrzysztofWisniewskiAcc commented May 31, 2023

Hey, I can confirm that we also got this on our 2.4.4-p3 commerce instance.
We recently upgraded from 2.4.2-p2 and this issue started to occur.

This behavior can be noticed when saving contents of: block/dynamic block/cms page
After clicking save you get a success message but the content was not updated.

This occurs very randomly, it's very hard to reproduce this.
I had few sessions trying to create a reproducible scenario, but without success.

Pretty sure it's not the browser issue as I was trying to reproduce this on firefox/chrome/safari/edge and it happened to me on all of those browsers, but only few times.

I'm pretty sure I was never able to reproduce this when I had my devtools opened.

@KrzysztofWisniewskiAcc
Copy link

KrzysztofWisniewskiAcc commented May 31, 2023

@Aleksejs-Prjahins were you able to solve the issue or at least find a reproducible scenario?

@nicolasbachmaier
Copy link

we have this same issue on our magento instance.
What we found out so far:

  • On Chromium based Browser it almost never works
  • On Firefox it works for most users (not everyone

This issue first occured a 2-3 months ago on our pre-update version 2.3.5. It as well occurs on magento v.2.4.4-p2 (but only on our B2B shop | B2C magento instance with the same version is working fine)

@lukas19944
Copy link

lukas19944 commented Jun 5, 2023

Error occurs randomly and it is caused due to wrong order loading js scripts.
In my case was more easy to reproduce this issue when browser developer tools was hidden.
This is the patch which solving this issue for module magento/module-page-builder:

index f7a5d86..e234b84 100644
--- a/view/adminhtml/requirejs-config.js
+++ b/view/adminhtml/requirejs-config.js
@@ -22,6 +22,9 @@ var config = {
         },
         'Magento_PageBuilder/js/resource/jquery/ui/jquery.ui.touch-punch': {
             deps: ['jquery/ui']
+        },
+        'Magento_PageBuilder/js/form/element/wysiwyg': {
+            deps: ['Magento_Ui/js/form/form']
         }
     },
     config: {

magento 2.4.4 and magento/module-page-builder 2.2.2

@n0kit31
Copy link

n0kit31 commented Jun 7, 2023

Error occurs randomly and it is caused due to wrong order loading js scripts. In my case was more easy to reproduce this issue when browser developer tools was hidden. This is the patch which solving this issue for module magento/module-page-builder:

index f7a5d86..e234b84 100644
--- a/view/adminhtml/requirejs-config.js
+++ b/view/adminhtml/requirejs-config.js
@@ -22,6 +22,9 @@ var config = {
         },
         'Magento_PageBuilder/js/resource/jquery/ui/jquery.ui.touch-punch': {
             deps: ['jquery/ui']
+        },
+        'Magento_PageBuilder/js/form/element/wysiwyg': {
+            deps: ['Magento_Ui/js/form/form']
         }
     },
     config: {

magento 2.4.4 and magento/module-page-builder 2.2.2

This one seems to really work and fix the issue 😲

@jeyoor
Copy link

jeyoor commented Jun 7, 2023

Closing the full-screen editing view in PageBuilder and then quickly clicking the save button seems to make this issue more likely to be reproduced

@engcom-Dash
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-November
Copy link
Contributor

Verified the issue again on Magento 2.4-develop instance with enterprise edition and B2B modules enabled and the issue is reproducible with below steps performed:
Steps performed:

  1. Enable Page builder modules on commerce instance
  2. login to Magento Admin - Content - Blocks - Create / edit block
  3. Edit with page builder
  4. Add Rows / text / heading
  5. Exit full screen mode and click on Save
    Issue: Success message is displayed but the page builder content is not getting saved
    image

@engcom-November engcom-November added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Jun 13, 2023
@m2-community-project m2-community-project bot removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Jun 13, 2023
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-8989 is successfully created for this GitHub issue.

@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels Jun 13, 2023
@m2-assistant
Copy link

m2-assistant bot commented Jun 13, 2023

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@engcom-November engcom-November added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Jun 13, 2023
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Jun 13, 2023
@KrzysztofWisniewskiAcc
Copy link

Hey, as for Today I was able to make some new findings.

In my case, it happened for me very rarely in the first place when I had developer mode & I didn't have any cache stuff in var/view_processed.
When I did turn production mode on, the bug started to occur quite often.

I tried the patch proposed above by @lukas19944 .
It seems it's not a valid solution, it lowers the frequency of bug appearance very highly, but it still happens occasionally.

@RanayCodes
Copy link

Steps to reproduce the issue :

Upgrade the chrome version to the latest, it will start reproducing.

This solution works like charm :

Error occurs randomly and it is caused due to wrong order loading JS scripts.

image

@nicolasbachmaier
Copy link

Explanation:
Currently when clicking "Save" a Post Request with the Website Content is fired BUT

  • The Post request has the old Website content instead of the new that you just changed because
    -- The responsible Javascript is not working (possible due to the above mentioned wrong loading order)

If you are required to make changes and none of the above Solutions work, you can modify the post request content and adjust the HTML code of the Pagebuilder. (A tedious workaround, but does the trick if everything else doesn't work)

@samvens
Copy link

samvens commented Sep 17, 2023

Error occurs randomly and it is caused due to wrong order loading js scripts. In my case was more easy to reproduce this issue when browser developer tools was hidden. This is the patch which solving this issue for module magento/module-page-builder:

index f7a5d86..e234b84 100644
--- a/view/adminhtml/requirejs-config.js
+++ b/view/adminhtml/requirejs-config.js
@@ -22,6 +22,9 @@ var config = {
         },
         'Magento_PageBuilder/js/resource/jquery/ui/jquery.ui.touch-punch': {
             deps: ['jquery/ui']
+        },
+        'Magento_PageBuilder/js/form/element/wysiwyg': {
+            deps: ['Magento_Ui/js/form/form']
         }
     },
     config: {

magento 2.4.4 and magento/module-page-builder 2.2.2

I'm also facing the same issue. How can I override magento/module-page-builder/view/adminhtml/requirejs-config.js and add this snippet? As It should not be added directly in vendor.

Please can someone let me know?

@samvens
Copy link

samvens commented Sep 18, 2023

@lukas19944 @n0kit31 how did you guys override default magento/module-page-builder/view/adminhtml/requirejs-config.js and resolved this issue? Please can you help?

@aleksandr-mikhailov
Copy link

I have debugged this behavior a little bit and, seems, found the cause of such intermittent behavior.

There is the following mixin related to registration of page builder instances and further form submit activities: vendor/magento/module-page-builder/view/adminhtml/web/js/form/form-mixin.js. It defines "pagebuilder:register" event in its initialize method, which is responsible for the mentioned registration.

Also, there is a WYSIWYG form element described in the vendor/magento/module-page-builder/view/adminhtml/web/js/form/element/wysiwyg.js which is triggering "pagebuilder:register" event during initialization (see initialize -> initPageBuilder methods)

Currently, there is no any direct relationships between these elements: Magento_PageBuilder/js/form/form-mixin is dependent on Magento_Ui/js/form/form, in turn, Magento_PageBuilder/js/form/element/wysiwyg is dependent to Magento_Ui/js/form/element/wysiwyg right now.

In rare cases "pagebuilder:register" event can be triggered from the WYSIWYG element prior to it's creation in the mentioned form mixin, and in such cases "Save" action performs relatively quick, and no any updates are applied for block content.

So, to be more precise, the following dependency could be added: Magento_PageBuilder/js/form/form-mixin instead of Magento_Ui/js/form/form.

@samvens you can add appropriate dependency into custom requirejs-config.js file in scope of custom extension

var config = {
    shim: {
        'Magento_PageBuilder/js/form/element/wysiwyg': {
            deps: ['Magento_PageBuilder/js/form/form-mixin']
        }
    },
}

or

var config = {
    shim: {
        'Magento_PageBuilder/js/form/element/wysiwyg': {
            deps: ['Magento_Ui/js/form/form']
        }
    },
}

@github-jira-sync-bot github-jira-sync-bot added Progress: PR Created Indicates that Pull Request has been created to fix issue and removed Progress: ready for grooming labels Nov 24, 2023
@engcom-Bravo
Copy link
Contributor

Hi @Aleksejs-Prjahins,

The issue's reproducibility was assessed by creating a block with numerous rows, columns, headings, and text fields across default, developer, and production modes in 2.4-develop.
Additionally, in developer mode, we experimented with toggling the merge and minify JavaScript settings, as well as the merge and minify CSS settings.
Despite these variations, the problem could not be replicated. Hence closing the issue
Below is the screencast:

Screen.Recording.2023-11-29.at.6.04.49.PM.mov

Thanks.

@m2-community-project m2-community-project bot moved this from Ready for Development to Done in High Priority Backlog Dec 4, 2023
@m2-community-project m2-community-project bot added Progress: done and removed Progress: PR Created Indicates that Pull Request has been created to fix issue labels Dec 4, 2023
@emanueleftimie
Copy link

Error occurs randomly and it is caused due to wrong order loading js scripts. In my case was more easy to reproduce this issue when browser developer tools was hidden. This is the patch which solving this issue for module magento/module-page-builder:

index f7a5d86..e234b84 100644
--- a/view/adminhtml/requirejs-config.js
+++ b/view/adminhtml/requirejs-config.js
@@ -22,6 +22,9 @@ var config = {
         },
         'Magento_PageBuilder/js/resource/jquery/ui/jquery.ui.touch-punch': {
             deps: ['jquery/ui']
+        },
+        'Magento_PageBuilder/js/form/element/wysiwyg': {
+            deps: ['Magento_Ui/js/form/form']
         }
     },
     config: {

magento 2.4.4 and magento/module-page-builder 2.2.2

I'm also facing the same issue. How can I override magento/module-page-builder/view/adminhtml/requirejs-config.js and add this snippet? As It should not be added directly in vendor.

Please can someone let me know?

try to use someting like https://github.com/cweagans/composer-patches

@cjayalmontecm
Copy link

cjayalmontecm commented Mar 13, 2024

Closing the full-screen editing view in PageBuilder and then quickly clicking the save button seems to make this issue more likely to be reproduced

Have you fix the issue @jeyoor ?

Hey, as for Today I was able to make some new findings.

In my case, it happened for me very rarely in the first place when I had developer mode & I didn't have any cache stuff in var/view_processed. When I did turn production mode on, the bug started to occur quite often.

I tried the patch proposed above by @lukas19944 . It seems it's not a valid solution, it lowers the frequency of bug appearance very highly, but it still happens occasionally.

Have you fix the issue @KrzysztofWisniewskiAcc ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: Content Component: PageBuilder Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

No branches or pull requests