From 717158ee321d4c8b6dc49c6a057c0701f0532dd5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 2 Aug 2021 20:54:44 +0000 Subject: [PATCH] Upgrade/Install: Store correct result when bulk updating plugins or themes. This ensures that when multiple plugins or themes are updated and one succeeds and another fails, the error is reported accordingly. Previously, both updates would end up treated as a success, due to `$this->result` containing the result of the previous operation and not the current one. Follow-up to [12097]. Props pwtyler, afragen. Fixes #53002. git-svn-id: https://develop.svn.wordpress.org/trunk@51528 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-plugin-upgrader.php | 2 +- src/wp-admin/includes/class-theme-upgrader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php index 09d02e2bfb..76083b5211 100644 --- a/src/wp-admin/includes/class-plugin-upgrader.php +++ b/src/wp-admin/includes/class-plugin-upgrader.php @@ -347,7 +347,7 @@ class Plugin_Upgrader extends WP_Upgrader { ) ); - $results[ $plugin ] = $this->result; + $results[ $plugin ] = $result; // Prevent credentials auth screen from displaying multiple times. if ( false === $result ) { diff --git a/src/wp-admin/includes/class-theme-upgrader.php b/src/wp-admin/includes/class-theme-upgrader.php index cd5f528466..c550314c5d 100644 --- a/src/wp-admin/includes/class-theme-upgrader.php +++ b/src/wp-admin/includes/class-theme-upgrader.php @@ -448,7 +448,7 @@ class Theme_Upgrader extends WP_Upgrader { ) ); - $results[ $theme ] = $this->result; + $results[ $theme ] = $result; // Prevent credentials auth screen from displaying multiple times. if ( false === $result ) {