@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Give audits a clickable commit title, even if they are importing or messageless

Summary:
Fixes T3854. Subversion allows commits with no message, and in other cases we might not have imported the message yet. In these cases, we may not render any text inside the link.

When we hit these cases, render appropriate replacement text.

Test Plan: {F156229}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T3854

Differential Revision: https://secure.phabricator.com/D9169

+23 -11
+23 -11
src/applications/audit/view/PhabricatorAuditListView.php
··· 66 66 67 67 private function getCommitDescription($phid) { 68 68 if ($this->commits === null) { 69 - return null; 69 + return pht('(Unknown Commit)'); 70 70 } 71 71 72 72 $commit = idx($this->commits, $phid); 73 73 if (!$commit) { 74 - return null; 74 + return pht('(Unknown Commit)'); 75 75 } 76 76 77 - return $commit->getCommitData()->getSummary(); 77 + $summary = $commit->getCommitData()->getSummary(); 78 + if (strlen($summary)) { 79 + return $summary; 80 + } 81 + 82 + // No summary, so either this is still impoting or just has an empty 83 + // commit message. 84 + 85 + if (!$commit->isImported()) { 86 + return pht('(Importing Commit...)'); 87 + } else { 88 + return pht('(Untitled Commit)'); 89 + } 78 90 } 79 91 80 92 public function render() { ··· 134 146 $author_name = $commit->getCommitData()->getAuthorName(); 135 147 136 148 $item = id(new PHUIObjectItemView()) 137 - ->setObjectName($commit_name) 138 - ->setHeader($commit_desc) 139 - ->setHref($commit_link) 140 - ->setBarColor($status_color) 141 - ->addAttribute($status_text) 142 - ->addAttribute($reasons) 143 - ->addIcon('none', $committed) 144 - ->addByline(pht('Author: %s', $author_name)); 149 + ->setObjectName($commit_name) 150 + ->setHeader($commit_desc) 151 + ->setHref($commit_link) 152 + ->setBarColor($status_color) 153 + ->addAttribute($status_text) 154 + ->addAttribute($reasons) 155 + ->addIcon('none', $committed) 156 + ->addByline(pht('Author: %s', $author_name)); 145 157 146 158 if (!empty($auditors)) { 147 159 $item->addAttribute(pht('Auditors: %s', $auditors));