From f2ca348b3a7a91a1f8bf8a061b592f9d60ec7dc9 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Wed, 5 Apr 2017 06:08:14 -0400 Subject: [PATCH] Set project's ObjectName to its PHID when it doesn't have a hashtag Summary: Fixes T12659. Previously this would lead to an error when trying to run `arc diff` on a revision that had a milestone as a reviewer (or any non-octothorpe'd Object Name) Test Plan: Followed repro steps in T12659 and didn't get the error described. Also clicked around and didn't notice any obvious regressions in projects or differential Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, yelirekim Maniphest Tasks: T12659 Differential Revision: https://secure.phabricator.com/D17807 --- .../project/phid/PhabricatorProjectProjectPHIDType.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php index 7a04103a7c..3aa6088780 100644 --- a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php +++ b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php @@ -47,6 +47,10 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType { $handle->setObjectName('#'.$slug); $handle->setURI("/tag/{$slug}/"); } else { + // We set the name to the project's PHID to avoid a parse error when a + // project has no hashtag (as is the case with milestones by default). + // See T12659 for more details + $handle->setCommandLineObjectName($project->getPHID()); $handle->setURI("/project/view/{$id}/"); }