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

Fix invalid logic in PhabricatorEmailPreferencesSettingsPanel::processRequest()

Summary:
The expression `$all_tags[$tag]['count']` does not do anything. Reading the surrounding code, intention is to display a "Common" section on `/settings/panel/emailpreferences/` listing MailTags defined by at least two different applications. (This is currently not the case anyway as Phorge prefixes all MailTags with their corresponding application but might be a future use case.)
This change fixes the logic accordingly.

Closes T15874

Test Plan: Apply the patch; replace the value of a random `const MAILTAG_*` line in the codebase with the value of another random `const MAILTAG_*` line in the codebase to make it "common", now see that `/settings/panel/emailpreferences/` displays this MailTag in a "Common" section on top of the options.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15874

Differential Revision: https://we.phorge.it/D25727

+3 -2
+3 -2
src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
··· 97 97 'count' => 0, 98 98 'name' => $name, 99 99 ); 100 + } else { 101 + $all_tags[$tag]['count']++; 100 102 } 101 - $all_tags[$tag]['count']; 102 103 } 103 104 } 104 105 105 106 $common_tags = array(); 106 107 foreach ($all_tags as $tag => $info) { 107 - if ($info['count'] > 1) { 108 + if ($info['count'] > 0) { 108 109 $common_tags[$tag] = $info['name']; 109 110 } 110 111 }