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

["BUG"] Notice: Function wp_enqueue_style was called incorrectly #101

Closed
felipemontoya opened this issue Oct 4, 2024 · 0 comments · Fixed by #102
Closed

["BUG"] Notice: Function wp_enqueue_style was called incorrectly #101

felipemontoya opened this issue Oct 4, 2024 · 0 comments · Fixed by #102
Assignees
Labels
bug Report of or fix for something that isn't working as intended help wanted Ready to be picked up by anyone in the community

Comments

@felipemontoya
Copy link
Member

Describe the bug

When the plugin is activated, the admin page shows a strong warning:

Notice: Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the openedx-commerce handle. Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 3.3.0.) in /www/stagingwoocommerceplugin_283/public/wp-includes/functions.php on line 6085

This is not breaking any functionality, but it is annoying and we should fix it.

To Reproduce
Steps to reproduce the behavior:

  1. Go to /wp-admin/plugins.php
  2. Click on "Open edX Commerce" > Activate
  3. See error

Screenshots

image

Additional context
I think this is related to a direct call to $this->loader->wp_enqueue_style here. We should add_action at admin_enqueue_scripts as the lines before do.

The styles we are including there are used for the log box in the sync manager
image

@felipemontoya felipemontoya added bug Report of or fix for something that isn't working as intended help wanted Ready to be picked up by anyone in the community labels Oct 4, 2024
@MaferMazu MaferMazu self-assigned this Oct 4, 2024
@MaferMazu MaferMazu mentioned this issue Oct 31, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended help wanted Ready to be picked up by anyone in the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants