• Resolved hothbricks

    (@hothbricks)


    I’m encountering a JavaScript error in the WordPress admin area that appears to be related to WPForms when the Block Editor (Gutenberg) is disabled.

    Environment

    • WordPress version: 6.9.1
    • WPForms version: 1.9.9.2
    • Gutenberg disabled using:
    add_filter( 'use_block_editor_for_post', '__return_false' );

    add_filter( 'use_widgets_block_editor', '__return_false' );

    On the following admin screens:

    • /wp-admin/edit.php (posts list)
    • /wp-admin/post.php
    • /wp-admin/post-new.php

    the browser console shows this error:

    TypeError: Cannot read properties of undefined (reading 'getEditedPostAttribute')
    at Object.getEditorTitle
    at Object.maybeShowGutenbergNotice
    in wpforms/assets/js/admin/education/edit-post.es5.min.js

    From what I can see, the script

    wpforms/assets/js/admin/education/edit-post.es5.min.js

    assumes the presence of the Gutenberg data store:

    wp.data.select('core/editor').getEditedPostAttribute(...)

    However, when Gutenberg is disabled, core/editor is not registered, so wp.data.select(‘core/editor’) returns undefined, which causes the exception.

    Expected behavior

    The script should either:

    • Only be enqueued when the Block Editor is active, or
    • Gracefully check for the existence of wp.data.select(‘core/editor’) before calling getEditedPostAttribute.

    Temporary workaround

    I resolved the issue locally by dequeuing this specific WPForms “education/edit-post” script on edit.php and post.php screens when Gutenberg is disabled, but this is only a workaround.

    I wanted to report this in case it’s an unintended enqueue condition in WPForms.

    Let me know if you need system info or additional details.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Amjad Ali

    (@amjadali688)

    Hi @hothbricks ,

    Thank you for alerting us about this and sorry for any trouble caused.

    Our development team has been made aware of this issue, and we are currently investigating. I will circle back as soon as I have some news!

    In the meantime, your workaround of dequeuing the education/edit-post script when Gutenberg is disabled is a good temporary solution, and you can continue using it if it works well in your setup while we work on a proper fix.

    Thank you again for the detailed report, we appreciate your patience!

    Plugin Support Amjad Ali

    (@amjadali688)

    Hi @hothbricks ,

    We have released WPForms Lite 1.9.9.4, which includes a fix for this issue. Please update the plugin to the latest version, and you should find that the JavaScript errors no longer appears.

    And if you have any questions about WPForms Lite, please feel free to reach out.

    Thanks!

    Thread Starter hothbricks

    (@hothbricks)

    Thanks !

    Plugin Support Amjad Ali

    (@amjadali688)

    Hi @hothbricks ,

    You’re welcome. Happy to help!

    Your experience is important to us, and we’d love to hear what you think about using WPForms.  Would you mind sharing a quick review? It only takes a minute and helps us keep improving!

    Here’s the link to leave a review and in case you’d like some guidance, this article walks you through the process.

    We appreciate your time and feedback!

    Thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.