From 71d04653310c02469f457741271b73fb535925c0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 10 Mar 2013 10:59:03 -0700 Subject: [PATCH] Fix two Pholio subscriptions issues Summary: - Grouping inline comments made us render `array(null)` for the content of a single comment. Detect that this corresponds to empty text. - Don't try to mention-subscribe automatic subscribers, like the author. Test Plan: Tried to mention-subscribe the author, saw no "x subscribed y" transaction generate. Added a real subscriber, saw no empty content render. Reviewers: chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5315 --- .../editor/PhabricatorApplicationTransactionEditor.php | 7 +++++-- src/view/layout/PhabricatorTimelineEventView.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index a27606e5e7..f9f51f1d8f 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -429,9 +429,12 @@ abstract class PhabricatorApplicationTransactionEditor $phids = array_diff($phids, $this->subscribers); } - if (!$phids) { - return null; + foreach ($phids as $key => $phid) { + if ($object->isAutomaticallySubscribed($phid)) { + unset($phids[$key]); + } } + $phids = array_values($phids); $xaction = newv(get_class(head($xactions)), array()); $xaction->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS); diff --git a/src/view/layout/PhabricatorTimelineEventView.php b/src/view/layout/PhabricatorTimelineEventView.php index e113de5f49..463f89452e 100644 --- a/src/view/layout/PhabricatorTimelineEventView.php +++ b/src/view/layout/PhabricatorTimelineEventView.php @@ -163,7 +163,7 @@ final class PhabricatorTimelineEventView extends AphrontView { $classes = array(); $classes[] = 'phabricator-timeline-event-view'; $classes[] = 'phabricator-timeline-border'; - if ($content) { + if (!$this->isEmptyContent($content)) { $classes[] = 'phabricator-timeline-major-event'; $content = phutil_tag( 'div', -- 2.54.0