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

Enabling Gutenberg breaks hook in the customizer #25417

Closed
nonamich opened this issue Sep 17, 2020 · 9 comments
Closed

Enabling Gutenberg breaks hook in the customizer #25417

nonamich opened this issue Sep 17, 2020 · 9 comments
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. Needs Testing Needs further testing to be confirmed.

Comments

@nonamich
Copy link

nonamich commented Sep 17, 2020

Describe the bug
Action admin_enqueue_scripts on customize.php does not work on the customizer admin screen when the Gutenberg plugin is activated.

To reproduce
Steps to reproduce the behavior:

  1. Activate the Gutenberg plugin
  2. Hook some script to admin_enqueue_scripts
  3. Go to Appearance > Customize
  4. Notice the script does not load.

Editor version (please complete the following information):

  • WordPress version: 5.5.2-alpha-48959
  • gutenberg plugin
  • Gutenberg version: 9.0.0

Desktop (please complete the following information):

  • WINDOWS
  • Browser chrome
  • Version 85.0.4183.102
@youknowriad
Copy link
Contributor

Hi there!

We'd need more information if you want us to help you.
Can you give an example of not working hook?
How is this related to Gutenberg?

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Sep 17, 2020
@nonamich
Copy link
Author

Hi there!

We'd need more information if you want us to help you.
Can you give an example of not working hook?
How is this related to Gutenberg?

I connect some scripts on the admin_enqueue_scripts hook that I use on all admin pages, but when the gutenberg plugin is activated, this hook does not work for me on the Customize page (wp-admin / customize.php), but although it does work before activation

@youknowriad youknowriad added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Sep 21, 2020
@youknowriad
Copy link
Contributor

, but when the gutenberg plugin is activated, this hook does not work for me on the Customize page (wp-admin / customize.php)

@dimaeromin97 Just to make sure I understand properly, is it the only script that doesn't work? or any hook loaded on admin_enqueue_scripts doesn't work? If it's specific to your own hook, would you mind explaining what it does or share it with us?

I wonder if this is related to the block-based customizer panel. cc @adamziel

@adamziel
Copy link
Contributor

I wonder if it's related as well! I'll add it to to triaging queue. Here are two potentially related issues: #25415 #15644

@draganescu
Copy link
Contributor

Blocked by #25625

@noisysocks
Copy link
Member

We'll be completely rearchitecting our implementation of how blocks work in the Customizer, but in the meantime let's investigate this to see if this hook is not being fired when the Gutenberg plugin is active. If so then let's fix that asap.

@skorasaurus skorasaurus added the [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. label Jan 28, 2021
@draganescu
Copy link
Contributor

This is not blocked anymore. I think #25415 is related too.

@draganescu draganescu changed the title hook on customize.php does not work Enabling Gutenberg breaks hook in the customizer Feb 18, 2021
@noisysocks
Copy link
Member

I'm not able to reproduce this.

I created a plugin with the following files, activated Gutenberg, enabled the Widgets in Customizer experiment, navigated to Appearance → Customize, and saw the alert dialog appear.

// my-plugin/my-plugin.php
/**
 * Plugin Name: My plugin
 */
add_action(
	'admin_enqueue_scripts',
	function() {
		wp_enqueue_script( 'my-script', plugin_dir_url( __FILE__ ) . 'my-script.js', array(), '1.0' );
	}
);
// my-plugin/my-script.js
alert( 'hello!' );

Let me know if I've misunderstood and we can reopen.

@bajoski34
Copy link

is this still a thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

7 participants