Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengine/PhabricatorEditEngine.php
Show First 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | final public function getBuiltinEngineConfigurations() { | ||||
if (!$has_default) { | if (!$has_default) { | ||||
$first = head($configurations); | $first = head($configurations); | ||||
if (!$first->getBuiltinKey()) { | if (!$first->getBuiltinKey()) { | ||||
$first | $first | ||||
->setBuiltinKey(self::EDITENGINECONFIG_DEFAULT) | ->setBuiltinKey(self::EDITENGINECONFIG_DEFAULT) | ||||
->setIsDefault(true) | ->setIsDefault(true) | ||||
->setIsEdit(true); | ->setIsEdit(true); | ||||
if (!strlen($first->getName())) { | $first_name = $first->getName(); | ||||
if ($first_name === null || $first_name === '') { | |||||
$first->setName($this->getObjectCreateShortText()); | $first->setName($this->getObjectCreateShortText()); | ||||
} | } | ||||
} else { | } else { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'EditEngine ("%s") returned builtin engine configurations, '. | 'EditEngine ("%s") returned builtin engine configurations, '. | ||||
'but none are marked as default and the first configuration has '. | 'but none are marked as default and the first configuration has '. | ||||
'a different builtin key already. Mark a builtin as default or '. | 'a different builtin key already. Mark a builtin as default or '. | ||||
▲ Show 20 Lines • Show All 2,261 Lines • Show Last 20 Lines |