Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block-based widgets screen doesn't load in the admin #585

Open
1 task done
dkotter opened this issue Oct 9, 2023 · 1 comment
Open
1 task done

Block-based widgets screen doesn't load in the admin #585

dkotter opened this issue Oct 9, 2023 · 1 comment
Assignees
Labels
help wanted Extra attention is needed needs:engineering This requires engineering to resolve.
Milestone

Comments

@dkotter
Copy link
Collaborator

dkotter commented Oct 9, 2023

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 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

  1. Ensure you're on the latest version of WordPress
  2. Activate the Twenty-Twenty One theme (or another theme that uses widgets)
  3. Configure the IBM Watson NLU provider
  4. 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
@dkotter dkotter added this to the 2.4.0 milestone Oct 9, 2023
@jeffpaul jeffpaul added the help wanted Extra attention is needed label Oct 10, 2023
@jeffpaul jeffpaul added the needs:engineering This requires engineering to resolve. label Oct 10, 2023
@jeffpaul jeffpaul moved this from Incoming to To Do in Open Source Practice Oct 10, 2023
@dkotter dkotter modified the milestones: 2.4.0, 2.5.0 Nov 7, 2023
@jeffpaul
Copy link
Member

Here's a video showing the issue from a user perspective: https://www.loom.com/share/0354ec183c4e423abe42cc3680e479d0?sid=d7a8856a-46ed-40ff-8ed2-65068ed4d2aa

@dkotter dkotter modified the milestones: 2.5.0, 2.6.0 Dec 12, 2023
@dkotter dkotter modified the milestones: 3.1.0, 3.2.0 Jul 12, 2024
@dkotter dkotter modified the milestones: 3.2.0, 3.3.0 Dec 11, 2024
@jeffpaul jeffpaul removed the type:bug label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs:engineering This requires engineering to resolve.
Projects
Status: To Do
Development

No branches or pull requests

3 participants