Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionEditController.php
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
if ($draft) { | if ($draft) { | ||||
$draft->delete(); | $draft->delete(); | ||||
} | } | ||||
$uri = PhrictionDocument::getSlugURI($document->getSlug()); | $uri = PhrictionDocument::getSlugURI($document->getSlug()); | ||||
return id(new AphrontRedirectResponse())->setURI($uri); | return id(new AphrontRedirectResponse())->setURI($uri); | ||||
} catch (PhabricatorApplicationTransactionValidationException $ex) { | } catch (PhabricatorApplicationTransactionValidationException $ex) { | ||||
$validation_exception = $ex; | $validation_exception = $ex; | ||||
$e_title = $ex->getShortMessage( | $e_title = nonempty( | ||||
PhrictionTransaction::TYPE_TITLE); | $ex->getShortMessage(PhrictionTransaction::TYPE_TITLE), | ||||
$e_content = $ex->getShortMessage( | true); | ||||
PhrictionTransaction::TYPE_CONTENT); | $e_content = nonempty( | ||||
$ex->getShortMessage(PhrictionTransaction::TYPE_CONTENT), | |||||
true); | |||||
btrahan: we were losing the "required" thing | |||||
// if we're not supposed to process the content version error, then | // if we're not supposed to process the content version error, then | ||||
// overwrite that content...! | // overwrite that content...! | ||||
if (!$editor->getProcessContentVersionError()) { | if (!$editor->getProcessContentVersionError()) { | ||||
$overwrite = true; | $overwrite = true; | ||||
} | } | ||||
$document->setViewPolicy($v_view); | $document->setViewPolicy($v_view); | ||||
$document->setEditPolicy($v_edit); | $document->setEditPolicy($v_edit); | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
we were losing the "required" thing