Differential D20286 Diff 48494 src/applications/project/controller/PhabricatorProjectColumnEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectColumnEditController.php
| Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $values = mpull($columns, 'getSequence'); | $values = mpull($columns, 'getSequence'); | ||||
| $new_sequence = max($values) + 1; | $new_sequence = max($values) + 1; | ||||
| } | } | ||||
| $column->setSequence($new_sequence); | $column->setSequence($new_sequence); | ||||
| } | } | ||||
| $xactions = array(); | $xactions = array(); | ||||
| $type_name = PhabricatorProjectColumnTransaction::TYPE_NAME; | $type_name = PhabricatorProjectColumnNameTransaction::TRANSACTIONTYPE; | ||||
| $type_limit = PhabricatorProjectColumnTransaction::TYPE_LIMIT; | $type_limit = PhabricatorProjectColumnLimitTransaction::TRANSACTIONTYPE; | ||||
| if (!$column->getProxy()) { | if (!$column->getProxy()) { | ||||
| $xactions[] = id(new PhabricatorProjectColumnTransaction()) | $xactions[] = id(new PhabricatorProjectColumnTransaction()) | ||||
| ->setTransactionType($type_name) | ->setTransactionType($type_name) | ||||
| ->setNewValue($v_name); | ->setNewValue($v_name); | ||||
| } | } | ||||
| $xactions[] = id(new PhabricatorProjectColumnTransaction()) | $xactions[] = id(new PhabricatorProjectColumnTransaction()) | ||||
| ->setTransactionType($type_limit) | ->setTransactionType($type_limit) | ||||
| ->setNewValue($v_limit); | ->setNewValue($v_limit); | ||||
| try { | try { | ||||
| $editor = id(new PhabricatorProjectColumnTransactionEditor()) | $editor = id(new PhabricatorProjectColumnTransactionEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setContinueOnMissingFields(true) | |||||
epriestley: This fixes a bug where this workflow didn't actually enforce the requirement that columns have… | |||||
| ->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
| ->applyTransactions($column, $xactions); | ->applyTransactions($column, $xactions); | ||||
| return id(new AphrontRedirectResponse())->setURI($view_uri); | return id(new AphrontRedirectResponse())->setURI($view_uri); | ||||
| } catch (PhabricatorApplicationTransactionValidationException $ex) { | } catch (PhabricatorApplicationTransactionValidationException $ex) { | ||||
| $e_name = $ex->getShortMessage($type_name); | $e_name = $ex->getShortMessage($type_name); | ||||
| $e_limit = $ex->getShortMessage($type_limit); | $e_limit = $ex->getShortMessage($type_limit); | ||||
| $validation_exception = $ex; | $validation_exception = $ex; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||
This fixes a bug where this workflow didn't actually enforce the requirement that columns have a name.