@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wiped ErrorView from PhrictionDeleteController

Summary: Exactly what it says on the tin

Test Plan: deleted an document in all kinds of fashions. No fatalities, no exceptions, all dialogs appeared fine.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2686

Differential Revision: https://secure.phabricator.com/D5331

authored by

Anh Nhan Nguyen and committed by
epriestley
f1be0152 05c5c431

+6 -22
+6 -22
src/applications/phriction/controller/PhrictionDeleteController.php
··· 21 21 return new Aphront404Response(); 22 22 } 23 23 24 - $error_view = null; 24 + $e_text = null; 25 25 $disallowed_states = array( 26 26 PhrictionDocumentStatus::STATUS_DELETED, // Stupid 27 27 PhrictionDocumentStatus::STATUS_MOVED, // Makes no sense 28 28 ); 29 29 if (in_array($document->getStatus(), $disallowed_states)) { 30 - $is_serious = 31 - PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 32 - 33 - if ($is_serious) { 34 - $e_text = pht('An already moved or deleted document can not be '. 35 - 'deleted'); 36 - } else { 37 - $e_text = pht('I\'m not sure if you got the notice, but you can\'t '. 38 - 'delete an already deleted or moved document.'); 39 - } 40 - 41 - $error_view = new AphrontErrorView(); 42 - $error_view->setSeverity(AphrontErrorView::SEVERITY_ERROR); 43 - $error_view->setTitle(pht('Can not delete page')); 44 - $error_view->appendChild($e_text); 45 - 46 - $error_view = $error_view->render(); 30 + $e_text = pht('An already moved or deleted document can not be deleted'); 47 31 } 48 32 49 33 $document_uri = PhrictionDocument::getSlugURI($document->getSlug()); 50 34 51 - if (!$error_view && $request->isFormPost()) { 35 + if (!$e_text && $request->isFormPost()) { 52 36 $editor = id(PhrictionDocumentEditor::newForSlug($document->getSlug())) 53 37 ->setActor($user) 54 38 ->delete(); 55 39 return id(new AphrontRedirectResponse())->setURI($document_uri); 56 40 } 57 41 58 - if ($error_view) { 42 + if ($e_text) { 59 43 $dialog = id(new AphrontDialogView()) 60 44 ->setUser($user) 61 - ->setTitle(pht('Error!')) 62 - ->appendChild($error_view) 45 + ->setTitle(pht('Can not delete document!')) 46 + ->appendChild($e_text) 63 47 ->addCancelButton($document_uri); 64 48 } else { 65 49 $dialog = id(new AphrontDialogView())