From 7154bea03c2cedd314220d519e6bed9eaf885237 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 3 Dec 2012 09:27:47 -0800 Subject: [PATCH] fixes two small diffusion bugs Summary: make sure we only print the fancy tool tip thing if we have all the data we need. (fixes T2136). additionally, default $branches to array() to prevent errors from reset on null. Test Plan: made a checkin for a mercurial repo with user "foo@bar" with no branch. verified name showed up in all views. also noted on commit detail view there was no more error about reset() on null for $branches. Reviewers: epriestley Reviewed By: epriestley CC: chad, aran, Korvin Maniphest Tasks: T2136 Differential Revision: https://secure.phabricator.com/D4065 --- .../diffusion/controller/DiffusionCommitController.php | 2 +- src/applications/diffusion/view/DiffusionView.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 8eb90f7bb3..157a24a0e4 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -254,7 +254,7 @@ final class DiffusionCommitController extends DiffusionController { $change_list->setRepository($repository); $change_list->setUser($user); // pick the first branch for "Browse in Diffusion" View Option - $branches = $commit_data->getCommitDetail('seenOnBranches'); + $branches = $commit_data->getCommitDetail('seenOnBranches', array()); $first_branch = reset($branches); $change_list->setBranch($first_branch); diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php index c079d816f0..1ae1befba7 100644 --- a/src/applications/diffusion/view/DiffusionView.php +++ b/src/applications/diffusion/view/DiffusionView.php @@ -133,7 +133,7 @@ abstract class DiffusionView extends AphrontView { final protected static function renderName($name) { $email = new PhutilEmailAddress($name); - if ($email->getDisplayName() || $email->getDomainName()) { + if ($email->getDisplayName() && $email->getDomainName()) { Javelin::initBehavior('phabricator-tooltips', array()); require_celerity_resource('aphront-tooltip-css'); return javelin_render_tag(