From 2f9c981716e582c09e69e9ab0dfd33a44d78836d Mon Sep 17 00:00:00 2001 From: Anh Nhan Nguyen Date: Thu, 14 Mar 2013 06:20:35 -0700 Subject: [PATCH] Oversight: Prevent deletion/movement of stub pages Summary: Refs T2686 - Now you also can't delete / move stubbed pages Test Plan: tried it out - works wonderful Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2686 Differential Revision: https://secure.phabricator.com/D5341 --- .../phriction/controller/PhrictionDeleteController.php | 1 + .../phriction/controller/PhrictionMoveController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/applications/phriction/controller/PhrictionDeleteController.php b/src/applications/phriction/controller/PhrictionDeleteController.php index 18670f100a..e48dff69fd 100644 --- a/src/applications/phriction/controller/PhrictionDeleteController.php +++ b/src/applications/phriction/controller/PhrictionDeleteController.php @@ -25,6 +25,7 @@ final class PhrictionDeleteController extends PhrictionController { $disallowed_states = array( PhrictionDocumentStatus::STATUS_DELETED, // Stupid PhrictionDocumentStatus::STATUS_MOVED, // Makes no sense + PhrictionDocumentStatus::STATUS_STUB, // How could they? ); if (in_array($document->getStatus(), $disallowed_states)) { $e_text = pht('An already moved or deleted document can not be deleted'); diff --git a/src/applications/phriction/controller/PhrictionMoveController.php b/src/applications/phriction/controller/PhrictionMoveController.php index abc90a275b..3eaac68b4e 100644 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -53,6 +53,7 @@ final class PhrictionMoveController $disallowed_statuses = array( PhrictionDocumentStatus::STATUS_DELETED, // Stupid PhrictionDocumentStatus::STATUS_MOVED, // Plain stupid + PhrictionDocumentStatus::STATUS_STUB, // Utterly stupid ); if (in_array($document->getStatus(), $disallowed_statuses)) { $error_view = new AphrontErrorView();