Page MenuHomePhabricator

Configured task priority keywords with uppercase letters can fail to map properly as defaults
Open, LowPublic

Description

See https://discourse.phabricator-community.org/t/misbehaving-default-priority-when-priority-keywords-contain-an-uppercase-letter/1150.

I was able to reproduce this by following the instructions. Note that you must not have EditEngine forms defined, because maniphest.default-priority is not used if you're creating a task with a customized form (instead, the form default value is used).

This "fixes" it but a better fix is likely a little more involved:

diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php
index d559299af..9b3c32499 100644
--- a/src/applications/maniphest/constants/ManiphestTaskPriority.php
+++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php
@@ -32,7 +32,10 @@ final class ManiphestTaskPriority extends ManiphestConstants {
       }
 
       foreach ($words as $word_key => $word) {
-        $words[$word_key] = phutil_utf8_strtolower($word);
+        $lower_word = phutil_utf8_strtolower($word);
+        if ($word != $lower_word) {
+          $words[] = $lower_word;
+        }
       }
 
       $words = array_unique($words);

Another "fix" is to perhaps to remove maniphest.default-priority since EditEngine forms can set defaults for any field, including priority.

Event Timeline

epriestley created this task.

Another option could be to only allow lowercase letters in the json specification, with some kind of warning message