Skip to content

Upgrade/Install: Keep the translation update selection after asking for credentials - #15909

Open
aryanjasala wants to merge 1 commit into
WordPress:trunkfrom
aryanjasala:fix/translation-update-selection
Open

aryanjasala wants to merge 1 commit into
WordPress:trunkfrom
aryanjasala:fix/translation-update-selection

Conversation

@aryanjasala

Copy link
Copy Markdown

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.

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

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.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

…or credentials.

When WordPress needs FTP or SSH credentials to update translations, the credentials form posts back to `update-core.php?action=do-translation-upgrade` without the fields of the Updates screen form. Since [65226], a request without those fields selects nothing, so the Updates screen reloads and no translation is installed. The upgrader URL now carries the selected updates, as it does for plugins and themes.

A plugin translation update is also named after the plugin that has its slug in the plugin update data, instead of a plugin whose main file has the same name.

Follow-up to [65226].

See #66663.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props aryanjasala.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant