Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/editor/DrydockBlueprintEditor.php
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
case DrydockBlueprintTransaction::TYPE_NAME: | case DrydockBlueprintTransaction::TYPE_NAME: | ||||
case DrydockBlueprintTransaction::TYPE_DISABLED: | case DrydockBlueprintTransaction::TYPE_DISABLED: | ||||
return; | return; | ||||
} | } | ||||
return parent::applyCustomExternalTransaction($object, $xaction); | return parent::applyCustomExternalTransaction($object, $xaction); | ||||
} | } | ||||
protected function validateTransaction( | |||||
PhabricatorLiskDAO $object, | |||||
$type, | |||||
array $xactions) { | |||||
$errors = parent::validateTransaction($object, $type, $xactions); | |||||
switch ($type) { | |||||
case DrydockBlueprintTransaction::TYPE_NAME: | |||||
$missing = $this->validateIsEmptyTextField( | |||||
$object->getBlueprintName(), | |||||
$xactions); | |||||
if ($missing) { | |||||
$error = new PhabricatorApplicationTransactionValidationError( | |||||
$type, | |||||
pht('Required'), | |||||
pht('You must choose a name for this blueprint.'), | |||||
nonempty(last($xactions), null)); | |||||
$error->setIsMissingFieldError(true); | |||||
$errors[] = $error; | |||||
continue; | |||||
} | |||||
break; | |||||
} | |||||
return $errors; | |||||
} | |||||
} | } |