From 2a80bdd448de95e58f4a24a1755603ab6ea989ba Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 16 Dec 2011 16:31:02 -0800 Subject: [PATCH] Hide auxiliary fields that have no value set Reviewers: epriestly --- .../ConduitAPI_differential_getcommitmessage_Method.php | 2 +- .../view/revisiondetail/DifferentialRevisionDetailView.php | 2 +- .../controller/taskdetail/ManiphestTaskDetailController.php | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php b/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php index 7bd106a3ee..8d1d395a09 100644 --- a/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php +++ b/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php @@ -107,7 +107,7 @@ class ConduitAPI_differential_getcommitmessage_Method extends ConduitAPIMethod { foreach ($aux_fields as $field_key => $field) { $value = $field->renderValueForCommitMessage($is_edit); $label = $field->renderLabelForCommitMessage(); - if ($value === null || !strlen($value)) { + if (!strlen($value)) { if ($field_key === 'title') { $commit_message[] = '<>'; } else { diff --git a/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php b/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php index e6d0dc46be..8f5e9d8469 100644 --- a/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php +++ b/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php @@ -53,7 +53,7 @@ final class DifferentialRevisionDetailView extends AphrontView { $rows = array(); foreach ($this->auxiliaryFields as $field) { $value = $field->renderValueForRevisionView(); - if ($value !== null) { + if (strlen($value)) { $label = $field->renderLabelForRevisionView(); $rows[] = ''. diff --git a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php index de455e3019..0bf1113ec5 100644 --- a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php @@ -147,7 +147,11 @@ class ManiphestTaskDetailController extends ManiphestController { $aux_field->setValue($attribute->getValue()); } - $dict[$aux_field->getLabel()] = $aux_field->renderForDetailView(); + $value = $aux_field->renderForDetailView(); + + if (strlen($value)) { + $dict[$aux_field->getLabel()] = $value; + } } }