From 5f95f2b6d51ec57a583f30b556e413878950eb43 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 24 Feb 2014 11:56:04 -0800 Subject: [PATCH] Fix variable issue on Conpherence draft saving pathway Summary: When we save a Conpherence draft, the draft part works fine but `$xactions` never gets defined, so this gets hit a little later on: [24-Feb-2014 11:46:10] WARNING: [pool www] child 82805 said into stderr: "NOTICE: PHP message: [2014-02-24 11:46:10] EXCEPTION: (RuntimeException) Undefined variable: xactions at [/INSECURE/devtools/libphutil/src/error/PhutilErrorHandler.php:211]" [24-Feb-2014 11:46:10] WARNING: [pool www] child 82805 said into stderr: "NOTICE: PHP message: #0 PhutilErrorHandler::handleError(8, Undefined variable: xactions, /INSECURE/devtools/phabricator/src/applications/conpherence/controller/ConpherenceUpdateController.php, 122, Array of size 13 starting with: { request => Object AphrontRequest }) called at [/INSECURE/devtools/phabricator/src/applications/conpherence/controller/ConpherenceUpdateController.php:122]" [24-Feb-2014 11:46:10] WARNING: [pool www] child 82805 said into stderr: "NOTICE: PHP message: #1 ConpherenceUpdateController::processRequest() called at [/INSECURE/devtools/phabricator/webroot/index.php:87]" Instead, define `$xactions`. Test Plan: - Type into Conpherence while tailing the error log. - After patch, clean error log. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D8323 --- .../conpherence/controller/ConpherenceUpdateController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index bca0338a4d..d548838fd0 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -37,6 +37,7 @@ final class ConpherenceUpdateController $e_file = array(); $errors = array(); $delete_draft = false; + $xactions = array(); if ($request->isFormPost()) { $editor = id(new ConpherenceEditor()) ->setContinueOnNoEffect($request->isContinueRequest()) @@ -59,7 +60,6 @@ final class ConpherenceUpdateController $delete_draft = true; break; case ConpherenceUpdateActions::ADD_PERSON: - $xactions = array(); $person_phids = $request->getArr('add_person'); if (!empty($person_phids)) { $xactions[] = id(new ConpherenceTransaction()) @@ -69,7 +69,6 @@ final class ConpherenceUpdateController } break; case ConpherenceUpdateActions::REMOVE_PERSON: - $xactions = array(); if (!$request->isContinueRequest()) { // do nothing; we'll display a confirmation dialogue instead break; @@ -95,7 +94,6 @@ final class ConpherenceUpdateController ->setContent($result); break; case ConpherenceUpdateActions::METADATA: - $xactions = array(); $updated = false; // all metadata updates are continue requests if (!$request->isContinueRequest()) {