1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

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
This commit is contained in:
Andre Klapper 2024-07-09 23:25:21 +02:00
parent 290883b2a9
commit ff7be2cf14

View file

@ -97,14 +97,15 @@ final class PhabricatorEmailPreferencesSettingsPanel
'count' => 0, 'count' => 0,
'name' => $name, 'name' => $name,
); );
} else {
$all_tags[$tag]['count']++;
} }
$all_tags[$tag]['count'];
} }
} }
$common_tags = array(); $common_tags = array();
foreach ($all_tags as $tag => $info) { foreach ($all_tags as $tag => $info) {
if ($info['count'] > 1) { if ($info['count'] > 0) {
$common_tags[$tag] = $info['name']; $common_tags[$tag] = $info['name'];
} }
} }