Support » Plugin: The Events Calendar Shortcode & Block » wp_enqueue_script() was called incorrectly. “wp-editor”

  • Resolved Carret

    (@carret)


    Hi,

    this notice can be seen in the widget block editor:

    Notice: wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /opt/lampp/htdocs/testsite/wp-includes/functions.php on line 5768

    When this plugin is disabled the notice disappears (WP 5.9.2 and The Events Calendar Shortcode & Block v2.5.2).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Brian Hogg

    (@brianhogg)

    Hi @carret ,

    Thanks for the note! I’m not able to replicate this notice, so it may have something to do with the theme. Have you tried using a default theme like TwentyTwenty to see if the notice still appears? Ensure you have a backup of the site before switching themes just in case.

    Also, is this notice appearing in the editor before you try to add the shortcode or block to the widget area, or after? Does it go away after you delete any blocks with the shortcode in it? The more detail on the steps to reproduce the better.

    Cheers!

    Thread Starter Carret

    (@carret)

    The error appears before and after using the shortcode or the block. And it keeps appearing even if I delete them.

    I have found that this notice occurs with ‘wp-editor’ in wp_register_script().

    And I found here the source of the problem and the solution:

    https://wordpress.org/support/topic/error-in-widgets-with-new-wordpress-version-5-8-wp_enqueue_script-and-wp/#post-15090381

    The Block Editor JavaScript module in 5.2

    In a quick test I have changed ‘wp-editor’ to ‘wp-block-editor’, and the notice disappears. (the-events-calendar-shortcode/block/init.php)

    Plugin Author Brian Hogg

    (@brianhogg)

    Thanks for the additional detail! We’ll see if we can replicate it and get a fix in an upcoming release.

    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @carret ,

    Thanks again for reporting the issue and tracking down a potential solution!

    Just wanted to keep you updated. While switching from wp-editor to wp-block-editor in init.php does resolve the notice, it then breaks the block itself (ie. the preview doesn’t generate). We’re still looking into a workaround.

    Cheers!

    Thread Starter Carret

    (@carret)

    Hello again.

    I’ve done some testing and in my case changing ‘wp-editor’ to ‘wp-block-editor’ seems to work fine. Both posts/pages and widgets show the preview when changing options in the block.

    I don’t know if there’s something I’m missing.

    • This reply was modified 4 months, 1 week ago by Carret.
    Plugin Author Brian Hogg

    (@brianhogg)

    Hi @carret,

    We were able to identify what seems to be the root cause, and released a fix today (2.5.5). If installing the update doesn’t fix the issue let us know, and thanks again for the initial issue report!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.