• 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 1 replies (of 1 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!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.