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

PHP Notice: wp_enqueue_script() was called incorrectly #995

Closed
marklchaves opened this issue Apr 7, 2022 · 1 comment
Closed

PHP Notice: wp_enqueue_script() was called incorrectly #995

marklchaves opened this issue Apr 7, 2022 · 1 comment

Comments

@marklchaves
Copy link
Contributor

Describe the bug

The following PHP notice gets logged when WP_DEBUG is on, Popup Maker is the only active plugin, and you're on the widgets.php admin page.

OP: https://wordpress.org/support/topic/error-on-widgets-php-with-wp_enqueue_script/

I've also reprex on my local test env using plugin-safe-mode.

https://twenty-twentyone.local/wp-admin/widgets.php?safe_mode=true&p1=popup-maker

Site information

Popup Maker version: 1.16.7

WordPress version: 5.9.3

PHP version: 8.0.12

Expected behavior

There should not be any PHP notices logged when on the widgets.php admin page.

Current behavior

Steps to reproduce

  1. Turn on WP_DEBUG.
  2. Disable all plugins except Popup Maker (optionally switch to the Twenty Twenty-One theme).
  3. Visit /wp-admin/ > Appearance > Widgets.
  4. View your debug.log.

Errors

debug.log

[07-Apr-2022 10:46:42 UTC] PHP 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 /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/functions.php on line 5775
[07-Apr-2022 10:46:42 UTC] PHP Stack trace:
[07-Apr-2022 10:46:42 UTC] PHP 1. {main}() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-admin/widgets.php:0
[07-Apr-2022 10:46:42 UTC] PHP 2. require() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-admin/widgets.php:32
[07-Apr-2022 10:46:42 UTC] PHP 3. require_once() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-admin/widgets-form-blocks.php:69
[07-Apr-2022 10:46:42 UTC] PHP 4. do_action() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-admin/admin-header.php:163
[07-Apr-2022 10:46:42 UTC] PHP 5. WP_Hook->do_action() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/plugin.php:474
[07-Apr-2022 10:46:42 UTC] PHP 6. WP_Hook->apply_filters() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/class-wp-hook.php:331
[07-Apr-2022 10:46:42 UTC] PHP 7. wp_check_widget_editor_deps() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/class-wp-hook.php:307
[07-Apr-2022 10:46:42 UTC] PHP 8. _doing_it_wrong() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/widgets.php:2090
[07-Apr-2022 10:46:42 UTC] PHP 9. trigger_error() /Users/markchaves/Local Sites/twenty-twentyone/app/public/wp-includes/functions.php:5775

Additional context

@danieliser
Copy link
Member

Resolved in develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants