Make WordPress Core

Opened 6 weeks ago

Closed 5 weeks ago

#66022 closed defect (bug) (fixed)

Correct Font Library and Connectors message when build files are not available

Reported by: afercia Owned by: afercia
Priority: normal Milestone: 7.2
Component: Administration Version:
Severity: normal Keywords: has-patch has-screenshots
Cc: Focuses: ui

Description

On the Font Library and Connectors pages, when build files are not available, a message is printed on the page. Respectively:

The Font Library requires Gutenberg build files. Please run <code>npm install</code> to build the necessary files.

and

The Connectors page requires build files. Please run <code>npm install</code> to build the necessary files.

  1. npm install is not the correct command to build files.
  2. The messages are inconsistent, where one refers to Gutenberg build files and hte other one to build files. I would argue the reference to Gutenberg should be omitted.

Change History (6)

#1 @iamchitti
6 weeks ago

Looked into this. npm install was correct when written — [61492] pointed the message at it because that changeset added a postinstall hook that built the Gutenberg assets. [62321] removed postinstall, and the message was never updated to follow. npm run build is the right command now.

Same for "Gutenberg build files": it's an implementation detail here, and dropping it makes both messages read consistently.

I'll open a PR for this.

This ticket was mentioned in ​PR #13365 on ​WordPress/wordpress-develop by ​@iamchitti.


6 weeks ago
#2

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/66022

The Font Library and Connectors screens tell the user to run npm install when build files are missing. That was correct when 61492 added a postinstall hook that built the assets; 62321 removed it and the messages were never updated. The two strings are also inconsistent — one says "Gutenberg build files", the other "build files".

## Changes

  • npm install → npm run build in both messages.
  • Dropped the "Gutenberg" reference so both strings read consistently.
  • Moved the command into a sprintf() placeholder with a translators comment, per src/index.php.

## Screenshots

### Font Library

Before After
https://github.com/user-attachments/assets/6d86e3a0-ee0f-4382-bd73-e79e7bd630ee https://github.com/user-attachments/assets/af463218-66aa-4101-80c0-c4788baf8f43

### Connectors

Before After
https://github.com/user-attachments/assets/dbaff9fe-62bc-4675-bec7-a6787928cb0f https://github.com/user-attachments/assets/72692349-566f-4051-84fa-65ca314454ef

## Use of AI

AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 5
Used for: Go through changesets

#3 @afercia
6 weeks ago

  • Owner set to afercia
  • Status new → assigned

Looked into this. npm install was correct when written

Right, I see it now. The postinstall script was first introduced in [61458] then it went through a few changes and it was finally removed in [62321].

​@afercia commented on ​PR #13365:


6 weeks ago
#4

@i-am-chitti thanks for exploring all the options. Personally, I'd suggest to just drop the command and use a generic sentence, because:

  • The location of a linked resource may change at any time and a link to it would become broken (and unnoticed).
  • The command itself may change in the future and maintaining these messages may be missed.

#5 @afercia
6 weeks ago

  • Keywords has-screenshots added
  • Milestone Awaiting Review → 7.2

#6 @afercia
5 weeks ago

  • Resolution → fixed
  • Status assigned → closed

In 63531:

Administration: Correct Font Library and Connectors message when build files are not available.

The previous message asked to run npm install, which is no longer the right command to build Gutenberg files in Core. Uses simpler messages instead.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13365

Props iamchitti, afercia.
Fixes #66022.

Note: See TracTickets for help on using tickets.