@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.

Only recognize "Fixes ..." in main revision content like the Summary or Test Plan

Summary:
Fixes T12642. Currently, writing "Fixes T..." in a comment gets picked up as a formal "fixes".

This is a bit confusing, and can also give you a "no effect" error if you "fixes ..." a task which is already "fixes"'d.

We could make the duplicate action a non-error, but just prevent the text from having an effect instead, which seems cleaner.

Test Plan:
- Wrote "Fixes ..." in a summary, saw a "fixes" relationship established.
- Wrote "Fixes ..." in a comment, got a "mention" instead.
- `var_dump()`'d some stuff as a sanity check, looked reasonable.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12642

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

+16 -5
+16 -5
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 1191 1191 array $changes, 1192 1192 PhutilMarkupEngine $engine) { 1193 1193 1194 - $flat_blocks = mpull($changes, 'getNewValue'); 1195 - $huge_block = implode("\n\n", $flat_blocks); 1196 - 1194 + // For "Fixes ..." and "Depends on ...", we're only going to look at 1195 + // content blocks which are part of the revision itself (like "Summary" 1196 + // and "Test Plan"), not comments. 1197 + $content_parts = array(); 1198 + foreach ($changes as $change) { 1199 + if ($change->getTransaction()->isCommentTransaction()) { 1200 + continue; 1201 + } 1202 + $content_parts[] = $change->getNewValue(); 1203 + } 1204 + if (!$content_parts) { 1205 + return array(); 1206 + } 1207 + $content_block = implode("\n\n", $content_parts); 1197 1208 $task_map = array(); 1198 1209 $task_refs = id(new ManiphestCustomFieldStatusParser()) 1199 - ->parseCorpus($huge_block); 1210 + ->parseCorpus($content_block); 1200 1211 foreach ($task_refs as $match) { 1201 1212 foreach ($match['monograms'] as $monogram) { 1202 1213 $task_id = (int)trim($monogram, 'tT'); ··· 1206 1217 1207 1218 $rev_map = array(); 1208 1219 $rev_refs = id(new DifferentialCustomFieldDependsOnParser()) 1209 - ->parseCorpus($huge_block); 1220 + ->parseCorpus($content_block); 1210 1221 foreach ($rev_refs as $match) { 1211 1222 foreach ($match['monograms'] as $monogram) { 1212 1223 $rev_id = (int)trim($monogram, 'dD');