Mercury Editor dialogs won't open after upgrading to Drupal core 10.3

Created on 22 June 2024, 5 months ago
Updated 16 July 2024, 4 months ago

Problem/Motivation

Mercury Editor can't be used with Drupal core 10.3

Steps to reproduce

After upgrading to Drupal core from 10.2 to 10.3, you would notice that you can't use Mercury Editor anymore.

Proposed resolution

Looks like this might be the reason https://www.drupal.org/node/3422670 โ†’

Remaining tasks

@TODO

User interface changes

N/A

API changes

N/A

Data model changes

N/A

๐Ÿ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany D34dMan Hamburg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @D34dMan
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany D34dMan Hamburg

    I was trying to see if I can fix this issue. While trying to compile the source file, I notice that it tries to build from `modules/mercury_editor_inline_editor` as well. But looks like it is safe to ignore that?

  • Issue was unassigned.
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany D34dMan Hamburg
  • ๐Ÿ‡จ๐Ÿ‡ดColombia jhina.riv@gmail.com

    jhina.riv@gmail.com โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡จ๐Ÿ‡ดColombia jhina.riv@gmail.com

    jhina.riv@gmail.com โ†’ changed the visibility of the branch 3456410-closing_bootstrap_modal_dialog to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States pbabin

    We are experiencing the same issue with ME and upgrading to 10.3

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States alison

    Same here! I go into the node editing form (existing basic page with mercury editor enabled, and layout paragraphs functionality), and I get this in browser console (Firefox on Windows 11):

    Uncaught TypeError: event is undefined
        handle https://my-site.pantheonsite.io/core/misc/dialog/dialog-deprecation.js?v=10.3.0:12
        jQuery 7
        openDialog https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/dialog.drupal.js?sfp58z:194
        show https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/dialog.drupal.js?sfp58z:217
        attach https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/edit-screen.js?sfp58z:168
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:166
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:162
        <anonymous> https://my-site.pantheonsite.io/core/modules/big_pipe/js/big_pipe.js?v=10.3.0:153
        <anonymous> https://my-site.pantheonsite.io/core/modules/big_pipe/js/big_pipe.js?v=10.3.0:184
    dialog-deprecation.js:12:24
    

    When I click the "plus" icon, it loads the paragraph picker dialog, but there's this in console:

    An error occurred during the execution of the Ajax response: TypeError: event is undefined ajax.js:1147:19
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1147
        (Async: promise callback)
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1145
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:588
        jQuery 6
        execute https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:711
        lpbUiClick https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/post-messages-listener.js?sfp58z:14
        attach https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/post-messages-listener.js?sfp58z:59
    

    Then I pick a paragraph type (button, in my case, because it's simple, just a plain text field and a link URL field), and the next dialog loads, but I get this in console:

    An error occurred during the execution of the Ajax response: TypeError: event is undefined ajax.js:1147:19
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1147
        (Async: promise callback)
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1145
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:588
        jQuery 6
        eventResponse https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:803
        Ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:650
        jQuery 8
        Ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:639
        ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:267
        bindAjaxLinks https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:335
        bindAjaxLinks https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:307
        attach https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:54
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:166
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:162
        insert https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1393
        jQuery 2
        insert https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1385
        openMercuryDialog https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/dialog.ajax.js?sfp58z:43
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1050
        (Async: promise callback)
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1043
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1040
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1099
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:588
        jQuery 6
        execute https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:711
        lpbUiClick https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/post-messages-listener.js?sfp58z:14
        attach https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/post-messages-listener.js?sfp58z:59
    

    Then, I fill in the two simple fields, and hit "Save" -- nothing happens, dialog stays up, no button is added to my layout -- and I get this in console:

    An error occurred during the execution of the Ajax response: TypeError: event is undefined ajax.js:1147:19
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1147
        (Async: promise callback)
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1145
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:588
        jQuery 9
        eventResponse https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:800
        Ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:650
        jQuery 8
        Ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:639
        ajax https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:267
        loadAjaxBehavior https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:47
        loadAjaxBehavior https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:44
        attach https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:52
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:166
        attachBehaviors https://my-site.pantheonsite.io/core/misc/drupal.js?v=10.3.0:162
        insert https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1393
        jQuery 2
        insert https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1385
        openMercuryDialog https://my-site.pantheonsite.io/modules/contrib/mercury_editor/build/js/dialog.ajax.js?sfp58z:43
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1050
        (Async: promise callback)
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1043
        commandExecutionQueue https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1040
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:1099
        success https://my-site.pantheonsite.io/core/misc/ajax.js?v=10.3.0:588
        jQuery 3
    

    "Cancel" also doesn't work, but the "X" at the top-right of the dialog does work, so that's how I make my escape.

  • First commit to issue fork.
  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justin2pin

    Hopefully MR55 is the ticket - this change dispatches the custom DrupalDialogEvent instead of using jQuery's trigger. This needs testing for backwards compatibility.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States pbabin

    Patched with MR55 in Drupal 10.3 without an issue and confirmed previous failing Cypress tests on our end our now passing. Thank you @just2pin for such a quick update.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States sethhill

    I installed this patch into a D10.2 site to test, and get this error:

    Uncaught ReferenceError: DrupalDialogEvent is not defined

    So this MR requires 10.3 as it stands at this moment.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States alison

    MR55 works for me on 10.3, too (was going to test on 10.2.6 buuuut thank you @sethhill for already doing that!)

  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States sethhill

    Tested on 10.2 and 10.3, and the latest changes seem to work well.

  • Pipeline finished with Skipped
    5 months ago
    #209991
  • Status changed to Fixed 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justin2pin
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly smurfxx

    Has this patch already been deployed or does it need to be applied manually? I wanted to test Mercury Editor but I'm on Drupal 10.3.0 and I'm getting the AJAX error shown above.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany D34dMan Hamburg

    Has this patch already been deployed or does it need to be applied manually? I wanted to test Mercury Editor but I'm on Drupal 10.3.0 and I'm getting the AJAX error shown above.

    @smurfxx, are you testing using 2.1.x-dev version?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly smurfxx

    Yes, I'm testing the 2.1.0+9-dev version

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024