{"record":{"id":"74812d6ccce17490","repo":"phacility/phabricator","slug":"key-s-is-not-a-valid-status-constant-status-co","errorCode":null,"errorMessage":"Key \"%s\" is not a valid status constant. Status constants must be 1-64 alphanumeric characters and cannot be exclusively digits. For example, \"%s\" or \"%s\" are reasonable choices.","messagePattern":"Key \"(.+?)\" is not a valid status constant\\. Status constants must be 1-64 alphanumeric characters and cannot be exclusively digits\\. For example, \"(.+?)\" or \"(.+?)\" are reasonable choices\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/maniphest/constants/ManiphestTaskStatus.php","lineNumber":264,"sourceCode":"  public static function isValidStatusConstant($constant) {\n    if (!strlen($constant) || strlen($constant) > 64) {\n      return false;\n    }\n\n    // Alphanumeric, but not exclusively numeric\n    if (!preg_match('/^(?![0-9]*$)[a-zA-Z0-9]+$/', $constant)) {\n      return false;\n    }\n    return true;\n  }\n\n  /**\n   * @task validate\n   */\n  public static function validateConfiguration(array $config) {\n    foreach ($config as $key => $value) {\n      if (!self::isValidStatusConstant($key)) {\n        throw new Exception(\n          pht(\n            'Key \"%s\" is not a valid status constant. Status constants '.\n            'must be 1-64 alphanumeric characters and cannot be exclusively '.\n            'digits. For example, \"%s\" or \"%s\" are reasonable choices.',\n            $key,\n            'open',\n            'closed'));\n      }\n      if (!is_array($value)) {\n        throw new Exception(\n          pht(\n            'Value for key \"%s\" should be a dictionary.',\n            $key));\n      }\n\n      PhutilTypeSpec::checkMap(\n        $value,\n        array(","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/maniphest/constants/ManiphestTaskStatus.php#L246-L282","documentation":"ManiphestTaskStatus::validateConfiguration requires every key of maniphest.statuses to be a valid status constant: 1-64 alphanumeric characters, not exclusively digits (isValidStatusConstant, same regex family as priorities). Statuses ship as constants like 'open', 'resolved', 'duplicate', so keys like 'in-progress', 'In Review', or '20' throw this Exception.","triggerScenarios":"A maniphest.statuses config containing a key with a hyphen, underscore, space, or non-ASCII characters ('in-progress', 'code_review', 'En Progreso'), or an all-digit key ('20'). The check runs per key before the value is examined.","commonSituations":"Customizing workflow statuses on workboards and copying display labels ('In Review') as constants instead of slugs. Status imports from other trackers that keep punctuation. Teams numbering statuses.","solutions":["Use lowercase alphanumeric slugs as constants: 'open', 'inreview' or 'inreview' style, max 64 chars, at least one letter.","Put the human-readable label in the value's 'name' / 'name.full' fields, not in the constant.","Run your keys through the same rule (alphanumeric, 1-64, not all digits) before writing config."],"exampleFix":"// before\n'in-progress' => array('name' => 'In Progress', ...),\n\n// after\n'inprogress' => array('name' => 'In Progress', ...),","handlingStrategy":"validation","validationCode":"foreach (array_keys($statuses) as $constant) {\n  if (!preg_match('/^(?![0-9]*$)[a-zA-Z0-9]+$/', $constant) || strlen($constant) > 64) {\n    throw new InvalidArgumentException(\"Invalid status constant '$constant'\");\n  }\n}","typeGuard":"function is_status_constant($s) { return is_string($s) && strlen($s) <= 64 && preg_match('/^(?![0-9]*$)[a-zA-Z0-9]+$/', $s) === 1; }","tryCatchPattern":null,"preventionTips":["Use lowercase alphanumeric slugs for constants; put labels in 'name'.","Slugify constants imported from other trackers.","No all-digit constants."],"tags":["phabricator","maniphest","configuration","status","constant-validation","slug-format"],"backgroundTag":"identifier-format-validation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}