From 331da5d47124aeaa12186354d7c963d05cd54694 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 3 Dec 2012 15:24:37 -0500 Subject: [PATCH] (bug 42483) Avoid serializing database object in update.php Change I96b4cfd4 changed the data being stored in updatelog, trying to store the mangled parameters (which may included an added copy of the DatabaseUpdater object itself) instead of the input parameters. This causes warnings because database objects cannot be effectively serialized. Go back to storing the original input parameters instead. Change-Id: I96e6dffed98772ebb9b812773ff2f608e7e40cb1 --- includes/installer/DatabaseUpdater.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 312b79660e..b200dcf161 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -321,9 +321,10 @@ abstract class DatabaseUpdater { foreach( $updates as $funcList ) { $func = $funcList[0]; $arg = $funcList[1]; + $origParams = $funcList[2]; $ret = call_user_func_array( $func, $arg ); flush(); - $this->updatesSkipped[] = $arg; + $this->updatesSkipped[] = $origParams; } } @@ -380,6 +381,7 @@ abstract class DatabaseUpdater { $updatesDone = array(); $updatesSkipped = array(); foreach ( $updates as $params ) { + $origParams = $params; $func = array_shift( $params ); if( !is_array( $func ) && method_exists( $this, $func ) ) { $func = array( $this, $func ); @@ -389,9 +391,9 @@ abstract class DatabaseUpdater { $ret = call_user_func_array( $func, $params ); flush(); if( $ret !== false ) { - $updatesDone[] = $params; + $updatesDone[] = $origParams; } else { - $updatesSkipped[] = array( $func, $params ); + $updatesSkipped[] = array( $func, $params, $origParams ); } } $this->updatesSkipped = array_merge( $this->updatesSkipped, $updatesSkipped ); -- 2.20.1