You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using a theme that uses block-based widgets (which I believe is the default experience for widgets since WordPress 5.8) and you have IBM Watson NLU configured, the admin widget screen doesn't load. A JS error gets logged in the console that is the cause of the problem.
In the NLU class we load a JS file specific to the block editor. This file ends up calling wp.data.select( 'core/editor' ).isSavingPost() which I guess doesn't exist within the widgets screen so it throws a JS error and processing stops, which then prevents the rest of the screen from loading. If I comment out that wp_enqueue_script block, the screen then loads.
I think we just need to ensure isSavingPost exists before we call it or maybe there's a better way to wrap this functionality to ensure it never throws errors.
Steps to Reproduce
Ensure you're on the latest version of WordPress
Activate the Twenty-Twenty One theme (or another theme that uses widgets)
Configure the IBM Watson NLU provider
Go to the admin widgets screen and notice the page doesn't show anything and an error shows in the browser console log
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
If using a theme that uses block-based widgets (which I believe is the default experience for widgets since WordPress 5.8) and you have IBM Watson NLU configured, the admin widget screen doesn't load. A JS error gets logged in the console that is the cause of the problem.
In the NLU class we load a JS file specific to the block editor. This file ends up calling
wp.data.select( 'core/editor' ).isSavingPost()
which I guess doesn't exist within the widgets screen so it throws a JS error and processing stops, which then prevents the rest of the screen from loading. If I comment out thatwp_enqueue_script
block, the screen then loads.I think we just need to ensure
isSavingPost
exists before we call it or maybe there's a better way to wrap this functionality to ensure it never throws errors.Steps to Reproduce
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: