[wp-trac] [WordPress Trac] #53002: Plugin_Upgrader's bulk_upgrade returns incorrect results when an error is encountered
WordPress Trac
noreply at wordpress.org
Thu Jun 10 17:28:19 UTC 2021
#53002: Plugin_Upgrader's bulk_upgrade returns incorrect results when an error is
encountered
-----------------------------+-----------------------------
Reporter: pwtyler | Owner: SergeyBiryukov
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 5.9
Component: Upgrade/Install | Version: 5.7
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+-----------------------------
Comment (by afragen):
https://github.com/WordPress/wordpress-develop/pull/1364
When bulk updating plugins/themes, the global `$this->result` is used to
identify the result of `$this->run()`. This seems to only update for the
first plugin/theme updated. Using the local variable `$result` seems to
fix this issue.
Using the example in the description.
{{{
$ wp plugin update --all
Downloading update from
https://downloads.wordpress.org/plugin/akismet.4.1.9.zip...
Using cached file '/Users/afragen/.wp-
cli/cache/plugin/akismet-4.1.9.zip'...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/wordpress-
importer.0.7.zip...
Using cached file '/Users/afragen/.wp-cli/cache/plugin/wordpress-
importer-0.7.zip'...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Warning: Could not remove the old plugin.
Plugin update failed.
+--------------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+--------------------+-------------+-------------+---------+
| akismet | 4.0 | 4.1.9 | Updated |
| wordpress-importer | 0.5 | 0.7 | Updated |
+--------------------+-------------+-------------+---------+
Success: Updated 2 of 2 plugins.
}}}
The success message is somewhere inside of WP-CLI.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53002#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list