Make WordPress Core

Opened 9 hours ago

Last modified 9 hours ago

#66663 assigned defect (bug)

Upgrade/Install: Translation updates are not installed when the Updates screen asks for FTP or SSH credentials

Reported by: aryanjasala Owned by: audrasjb
Priority: normal Milestone: 7.2
Component: Upgrade/Install Version: trunk
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

Follow-up to #42281 and [65226].

Since [65226], the Updates screen lets you pick which translation updates to install. On a site where WordPress needs FTP or SSH credentials to write files, the picked translations are never installed.

The credentials form posts back to update-core.php?action=do-translation-upgrade with only its own fields. WP_Upgrader_Skin::request_filesystem_credentials() passes no extra fields, so translations[] and checked[] are not sent again. wp_process_translation_update_selection() returns false for that request and update-core.php redirects to the Updates screen. Nothing is installed and no error is shown.

Before [65226] the same request ran bulk_upgrade() for all translation updates, so this is a regression. Plugin and theme updates don't have this problem because their upgrader URL carries the selection (update.php?action=update-selected&plugins=...).

Steps to reproduce

  1. On a site with at least one translation update available, set the filesystem method to something other than direct, with no FTP_* constants:
    <?php
    define( 'FS_METHOD', 'ftpext' );
    
  2. Go to Dashboard > Updates, select a translation and click "Update Translations".
  3. Fill in the "Connection Information" form and click "Proceed".

Expected: the selected translation is installed.

Actual: the Updates screen reloads and nothing is installed.

Tested on 7.2-beta5-65392. On trunk, submitting the credentials form returns a 302 to update-core.php. The upgrader never runs.

Wrong plugin name on the same screen

wp_get_translation_update_plugin_names() adds the slugs from the plugin update data first, then overwrites them with keys built from each plugin's directory and main file name. With bar/bar.php ("Bar") and zeta/bar.php ("Zeta") installed, the translation update for bar is listed as "Zeta". Since the name is now what you pick a translation by, it should be right.

Use of AI tools: I used Claude Code to write the patch. I reproduced the bug end to end and reviewed the fix myself.

Change History (3)

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


9 hours ago
#1

  • Keywords has-patch has-unit-tests added

When WordPress needs FTP or SSH credentials, the "Connection Information" form posts back to update-core.php?action=do-translation-upgrade without translations[] and checked[]. Since [65226], wp_process_translation_update_selection() returns false for that request and the Updates screen reloads, so the selected translations are never installed.

This change:

  • Carries the selected update IDs in the upgrader URL (&translations=<id>,<id>), the same way plugin and theme updates do. The request after the credentials form reads them from there. Deferrals made by the first request are kept.
  • Builds the plugin names in wp_get_translation_update_plugin_names() from the least to the most reliable key: main file names, then plugin files and directories, then slugs from the plugin update data. Before, a plugin whose main file was named after another plugin's slug showed that plugin's name (bar/bar.php and zeta/bar.php, the update for bar was named "Zeta").

Tests: three new tests in includesUpdate.php (--group 66663) cover both plugin name orders and a second selection request after the credentials form. The two plugin name tests fail on trunk. The file (28 tests) passes on single site and multisite, and PHPCS reports no errors. update-core.php has no unit tests, so the credentials flow was tested end to end on 7.2-beta5-65392 with define( 'FS_METHOD', 'ftpext' );: on trunk the credentials form returns a 302 to the Updates screen and nothing runs, with this change the upgrader runs for the selected translation.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Writing the patch and tests. I reproduced the bug end to end, reviewed the patch and checked the test results.

#2 @aryanjasala
9 hours ago

Patch: ​PR 15909 carries the selected update IDs in the upgrader URL, the same way plugin and theme updates do, and builds the plugin names from the least to the most reliable key. Three new tests (--group 66663). The credentials flow has no unit tests, so I tested it end to end with FS_METHOD set to ftpext.

#3 @jorbin
9 hours ago

  • Owner set to audrasjb
  • Status new → assigned

Assigning to @audrasjb as the committer of r65226.

Note: See TracTickets for help on using tickets.