From c98be54bf4e6b801be3672db59f0448aa97884ec Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 17 Apr 2017 16:11:02 -0700 Subject: [PATCH] Don't show tag when no topic is set Summary: Check the strlen of topic before adding a tag to the header in Conpherence. Test Plan: Remove a topic, no longer see indigo bubble. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17715 --- .../controller/ConpherenceController.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php index b4fcc59f2a..8154dc3174 100644 --- a/src/applications/conpherence/controller/ConpherenceController.php +++ b/src/applications/conpherence/controller/ConpherenceController.php @@ -60,19 +60,22 @@ abstract class ConpherenceController extends PhabricatorController { if ($conpherence->getID()) { $data = $conpherence->getDisplayData($this->getViewer()); - $topic = id(new PHUITagView()) - ->setName($data['topic']) - ->setShade(PHUITagView::COLOR_VIOLET) - ->setType(PHUITagView::TYPE_SHADE) - ->addClass('conpherence-header-topic'); $header = id(new PHUIHeaderView()) ->setViewer($viewer) ->setHeader($data['title']) - ->addTag($topic) ->setPolicyObject($conpherence) ->setImage($data['image']); + if (strlen($data['topic'])) { + $topic = id(new PHUITagView()) + ->setName($data['topic']) + ->setShade(PHUITagView::COLOR_VIOLET) + ->setType(PHUITagView::TYPE_SHADE) + ->addClass('conpherence-header-topic'); + $header->addTag($topic); + } + $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $conpherence,