-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 unit tests are failing #45254
Comments
Looks like the issue is in It seems like it’s been superseded in Core by Immediately following questions:
|
Inspecting [131] => wp-block-post-comment
[132] => wp-block-post-comment-editor
[133] => wp-block-post-comments-count
[134] => wp-block-post-comments-count-editor
[135] => Array
(
[0] => wp-block-post-comments-form
[1] => wp-block-buttons
[2] => wp-block-button
)
[136] => wp-block-post-comments-form-editor
[137] => wp-block-post-comments-link
[138] => wp-block-post-comments-link-editor Current working hypothesis: It was probably fixed in Core, by the very PR that introduced the And it was probably my back-compat fix that changed the behavior of the un-suffixed I'll work on a fix shortly. |
FWIW, here's the corresponding output for
Note that the array at 135 is flattened to its first item. |
Before I commit to the simple solution -- picking the first array item -- I'd like to verify that that was indeed the behavior before WordPress/wordpress-develop#3108, or if we should have For reference, this is the "simple solution": diff --git a/lib/compat/wordpress-6.0/client-assets.php b/lib/compat/wordpress-6.0/client-assets.php
index 0c5697817a..9c77b089eb 100644
--- a/lib/compat/wordpress-6.0/client-assets.php
+++ b/lib/compat/wordpress-6.0/client-assets.php
@@ -61,15 +61,27 @@ function gutenberg_resolve_assets() {
foreach ( $block_registry->get_all_registered() as $block_type ) {
if ( ! empty( $block_type->style ) ) {
- $style_handles[] = $block_type->style;
+ if ( is_array( $block_type->style ) ) {
+ $style_handles[] = $block_type->style[0];
+ } else {
+ $style_handles[] = $block_type->style;
+ }
}
if ( ! empty( $block_type->editor_style ) ) {
- $style_handles[] = $block_type->editor_style;
+ if ( is_array( $block_type->editor_style ) ) {
+ $style_handles[] = $block_type->editor_style[0];
+ } else {
+ $style_handles[] = $block_type->editor_style;
+ }
}
if ( ! empty( $block_type->script ) ) {
- $script_handles[] = $block_type->script;
+ if ( is_array( $block_type->script ) ) {
+ $style_handles[] = $block_type->script[0];
+ } else {
+ $style_handles[] = $block_type->script;
+ }
}
}
|
Just noting this also results in a fatal error on PHP8, and an obscene number of Notices/Warnings on wordpress.org/gutenberg/ :)
|
I created a PR with a straightforward fix - #45265. |
Description
First reported in Slack.
PHP unit tests in the Gutenberg repo have been failing since some time after 13:56 UTC and before 14:20 UTC. Unfortunately, this seems to point at my own core commit (from 14:14 UTC)
The failure is
Step-by-step reproduction instructions
Check any commit on GB's
trunk
that was merged after 2022-10-24 14:14 UTC.Its PHP unit tests are failing with
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: