@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

Don't render the Maniphest edit form bottom-of-page preview panel if "Description" is locked or hidden

Summary:
See <https://discourse.phabricator-community.org/t/hidden-description-field-in-maniphest-task-breaks-form/1432>.

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

+8
+8
src/applications/transactions/editfield/PhabricatorEditField.php
··· 302 302 } 303 303 304 304 public function getPreviewPanel() { 305 + if ($this->getIsHidden()) { 306 + return null; 307 + } 308 + 309 + if ($this->getIsLocked()) { 310 + return null; 311 + } 312 + 305 313 return $this->previewPanel; 306 314 } 307 315