Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public function render( $options = array() ) {
}
}

if ( ! empty( $this->block_type->view_script_module_ids ) ) {
if ( ! empty( $this->block_type->view_script_module_ids ) && ! is_admin() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extra condition differs from the view_script_handles block above. I'd like to understand why the behavior is different and requires this change for modules but not for scripts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, wouldn't it also be applicable for view_script_handles? I'm guessing those scripts are also being erroneously enqueued in the block editor currently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really needs some debugging and an explanation. I don't think this change should move ahead until there's an understanding of why these systems behave differently.

It's possible that there another issue going on, perhaps an issue with scripts, or it may be that this change should also be applied to scripts.

foreach ( $this->block_type->view_script_module_ids as $view_script_module_id ) {
wp_enqueue_script_module( $view_script_module_id );
}
Expand Down
Loading