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

Created on 22 June 2024, 6 days ago
Updated 27 June 2024, about 19 hours 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 2 days 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 1 day ago
  • πŸ‡ΊπŸ‡ΈUnited States sethhill

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

  • Pipeline finished with Skipped
    about 19 hours ago
    #209991
  • Status changed to Fixed about 19 hours ago
  • πŸ‡ΊπŸ‡ΈUnited States justin2pin
Production build 0.69.0 2024