Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@ module.exports = function(grunt) {
// Strip the 'library/' prefix from filePath values so they
// resolve correctly relative to wp-includes/images/icon-library/.
.replace(
/'filePath' => 'library\//g,
'\'filePath\' => \''
/'filePath'(\s+)=> 'library\//g,
'\'filePath\'$1=> \''
Comment on lines +814 to +815

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Core copies the icon SVGs flat into wp-includes/images/icon-library/, so this step rewrites the manifest paths to match: 'library/plus.svg' becomes 'plus.svg'.

Gutenberg 24.1 added a collections key to each icon, and the code formatter now pads the shorter keys with extra spaces:

// Before (24.0)
'filePath' => 'library/plus.svg',

// After (24.1)
'filePath'    => 'library/plus.svg',
'collections' => array( 'core', 'core-admin' ),

The old regex expected exactly one space before =>, so it stopped matching. As a result, library/ stayed in every path, and core tried to load files like icon-library/library/plus.svg that don't exist. That broke every icon and caused the icon PHPUnit failures.

(\s+) now matches any amount of padding, and $1 puts the same spacing back.

);
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
"sha": "50ad79ef7ebc5f1d2a75def068887e33a15f2634",
"sha": "954fe7f9e04631c41aec4552acd627a7203a2aad",
"ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
},
"engines": {
Expand Down
24 changes: 14 additions & 10 deletions src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,6 @@
'wp-includes/images/icon-library/border.svg',
'wp-includes/images/icon-library/box.svg',
'wp-includes/images/icon-library/breadcrumbs.svg',
'wp-includes/images/icon-library/brush.svg',
'wp-includes/images/icon-library/bug.svg',
'wp-includes/images/icon-library/button.svg',
'wp-includes/images/icon-library/buttons.svg',
Expand Down Expand Up @@ -969,7 +968,6 @@
'wp-includes/images/icon-library/currency-pound.svg',
'wp-includes/images/icon-library/custom-link.svg',
'wp-includes/images/icon-library/custom-post-type.svg',
'wp-includes/images/icon-library/dashboard.svg',
'wp-includes/images/icon-library/details.svg',
'wp-includes/images/icon-library/drafts.svg',
'wp-includes/images/icon-library/drag-handle.svg',
Expand Down Expand Up @@ -1035,7 +1033,6 @@
'wp-includes/images/icon-library/line-dotted.svg',
'wp-includes/images/icon-library/line-solid.svg',
'wp-includes/images/icon-library/link-off.svg',
'wp-includes/images/icon-library/link.svg',
'wp-includes/images/icon-library/list-item.svg',
'wp-includes/images/icon-library/list-view.svg',
'wp-includes/images/icon-library/list.svg',
Expand All @@ -1046,7 +1043,6 @@
'wp-includes/images/icon-library/loop.svg',
'wp-includes/images/icon-library/math.svg',
'wp-includes/images/icon-library/media-and-text.svg',
'wp-includes/images/icon-library/media.svg',
'wp-includes/images/icon-library/megaphone.svg',
'wp-includes/images/icon-library/more.svg',
'wp-includes/images/icon-library/move-to.svg',
Expand All @@ -1057,13 +1053,10 @@
'wp-includes/images/icon-library/offline.svg',
'wp-includes/images/icon-library/overlay-text.svg',
'wp-includes/images/icon-library/page-break.svg',
'wp-includes/images/icon-library/page.svg',
'wp-includes/images/icon-library/pages.svg',
'wp-includes/images/icon-library/pending.svg',
'wp-includes/images/icon-library/percent.svg',
'wp-includes/images/icon-library/pin-small.svg',
'wp-includes/images/icon-library/pin.svg',
'wp-includes/images/icon-library/plugins.svg',
'wp-includes/images/icon-library/plus-circle-filled.svg',
'wp-includes/images/icon-library/position-center.svg',
'wp-includes/images/icon-library/position-left.svg',
Expand Down Expand Up @@ -1141,7 +1134,6 @@
'wp-includes/images/icon-library/thumbs-up.svg',
'wp-includes/images/icon-library/time-to-read.svg',
'wp-includes/images/icon-library/title.svg',
'wp-includes/images/icon-library/tool.svg',
'wp-includes/images/icon-library/trash.svg',
'wp-includes/images/icon-library/trending-down.svg',
'wp-includes/images/icon-library/trending-up.svg',
Expand All @@ -1150,11 +1142,9 @@
'wp-includes/images/icon-library/ungroup.svg',
'wp-includes/images/icon-library/unlock.svg',
'wp-includes/images/icon-library/unseen.svg',
'wp-includes/images/icon-library/update.svg',
'wp-includes/images/icon-library/video.svg',
'wp-includes/images/icon-library/widget.svg',
'wp-includes/images/icon-library/word-count.svg',
'wp-includes/images/icon-library/wordpress.svg',
'wp-admin/images/about-header-credits.webp',
'wp-admin/images/about-header-credits-rtl.webp',
'wp-admin/images/about-header-default.webp',
Expand All @@ -1166,6 +1156,20 @@
'wp-admin/images/about-header-privacy.webp',
'wp-admin/images/about-header-privacy-rtl.webp',
'wp-admin/images/about-release-logo.svg',
/*
* Restored in WordPress 7.2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These icons were removed in 7.1 and added to $_old_files, but Gutenberg 24.1 adds them back to the icon library. Leaving them in $_old_files would delete them on upgrade and makes the verify:old-files build task fail, so they are removed from the list and kept as a comment, following the existing "Restored in WordPress 7.1." convention.

*
* 'wp-includes/images/icon-library/brush.svg',
* 'wp-includes/images/icon-library/dashboard.svg',
* 'wp-includes/images/icon-library/link.svg',
* 'wp-includes/images/icon-library/media.svg',
* 'wp-includes/images/icon-library/page.svg',
* 'wp-includes/images/icon-library/pin.svg',
* 'wp-includes/images/icon-library/plugins.svg',
* 'wp-includes/images/icon-library/tool.svg',
* 'wp-includes/images/icon-library/update.svg',
* 'wp-includes/images/icon-library/wordpress.svg',
*/
);

/**
Expand Down
Loading
Loading