1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

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
This commit is contained in:
epriestley 2014-02-24 11:56:04 -08:00
parent 14627ad65b
commit 5f95f2b6d5

View file

@ -37,6 +37,7 @@ final class ConpherenceUpdateController
$e_file = array(); $e_file = array();
$errors = array(); $errors = array();
$delete_draft = false; $delete_draft = false;
$xactions = array();
if ($request->isFormPost()) { if ($request->isFormPost()) {
$editor = id(new ConpherenceEditor()) $editor = id(new ConpherenceEditor())
->setContinueOnNoEffect($request->isContinueRequest()) ->setContinueOnNoEffect($request->isContinueRequest())
@ -59,7 +60,6 @@ final class ConpherenceUpdateController
$delete_draft = true; $delete_draft = true;
break; break;
case ConpherenceUpdateActions::ADD_PERSON: case ConpherenceUpdateActions::ADD_PERSON:
$xactions = array();
$person_phids = $request->getArr('add_person'); $person_phids = $request->getArr('add_person');
if (!empty($person_phids)) { if (!empty($person_phids)) {
$xactions[] = id(new ConpherenceTransaction()) $xactions[] = id(new ConpherenceTransaction())
@ -69,7 +69,6 @@ final class ConpherenceUpdateController
} }
break; break;
case ConpherenceUpdateActions::REMOVE_PERSON: case ConpherenceUpdateActions::REMOVE_PERSON:
$xactions = array();
if (!$request->isContinueRequest()) { if (!$request->isContinueRequest()) {
// do nothing; we'll display a confirmation dialogue instead // do nothing; we'll display a confirmation dialogue instead
break; break;
@ -95,7 +94,6 @@ final class ConpherenceUpdateController
->setContent($result); ->setContent($result);
break; break;
case ConpherenceUpdateActions::METADATA: case ConpherenceUpdateActions::METADATA:
$xactions = array();
$updated = false; $updated = false;
// all metadata updates are continue requests // all metadata updates are continue requests
if (!$request->isContinueRequest()) { if (!$request->isContinueRequest()) {