From fddb506e987fdae149a1dd6d28dd22f7de399880 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 7 May 2018 13:55:00 -0700 Subject: [PATCH] Don't render the Maniphest edit form bottom-of-page preview panel if "Description" is locked or hidden Summary: See . If you hide the "Description" field in Maniphest, we still try to render a remarkup preview for it. This causes a JS error and a nonfunctional element on the page. Instead, hide the preview panel if the field has been locked or hidden. Test Plan: - Hid the field, loaded the form, no more preview panel / JS error. - Used a normal form with the field visible, saw a normal preview. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D19432 --- .../transactions/editfield/PhabricatorEditField.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php index 94c95a5052..07bf3589a8 100644 --- a/src/applications/transactions/editfield/PhabricatorEditField.php +++ b/src/applications/transactions/editfield/PhabricatorEditField.php @@ -302,6 +302,14 @@ abstract class PhabricatorEditField extends Phobject { } public function getPreviewPanel() { + if ($this->getIsHidden()) { + return null; + } + + if ($this->getIsLocked()) { + return null; + } + return $this->previewPanel; }