{"record":{"id":"4ca847565de6da54","repo":"phacility/phabricator","slug":"unknown-revision-status-filter-constant-s","errorCode":null,"errorMessage":"Unknown revision status filter constant \"%s\".","messagePattern":"Unknown revision status filter constant \"(.+?)\"\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/constants/DifferentialLegacyQuery.php","lineNumber":25,"sourceCode":"  const STATUS_OPEN           = 'status-open';\n  const STATUS_ACCEPTED       = 'status-accepted';\n  const STATUS_NEEDS_REVIEW   = 'status-needs-review';\n  const STATUS_NEEDS_REVISION = 'status-needs-revision';\n  const STATUS_CLOSED         = 'status-closed';\n  const STATUS_ABANDONED      = 'status-abandoned';\n\n  public static function getAllConstants() {\n    return array_keys(self::getMap());\n  }\n\n  public static function getModernValues($status) {\n    if ($status === self::STATUS_ANY) {\n      return null;\n    }\n\n    $map = self::getMap();\n    if (!isset($map[$status])) {\n      throw new Exception(\n        pht(\n          'Unknown revision status filter constant \"%s\".',\n          $status));\n    }\n\n    return $map[$status];\n  }\n\n  private static function getMap() {\n    $all = array_keys(DifferentialRevisionStatus::getAll());\n\n    $open = array();\n    $closed = array();\n\n    foreach ($all as $status) {\n      $status_object = DifferentialRevisionStatus::newForStatus($status);\n      if ($status_object->isClosedStatus()) {\n        $closed[] = $status_object->getKey();","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/constants/DifferentialLegacyQuery.php#L7-L43","documentation":"DifferentialLegacyQuery::getModernValues() translates legacy status filter constants (STATUS_ANY, STATUS_OPEN, STATUS_ACCEPTED, and so on) into modern status lists for the query engine. Any value that is not a key of the legacy map throws. differential.query feeds its status parameter straight into this method.","triggerScenarios":"Calling differential.query with a status string that is not a legacy constant — misspellings, modern status names, or invented values such as 'open' instead of 'status-open'.","commonSituations":"Scripts written against the modern search API whose status values leak into legacy calls; typo'd constants; old integrations after new statuses were added that never received legacy names.","solutions":["Use the legacy constants differential.query documents — 'status-any', 'status-open', 'status-accepted', and so on — or DifferentialLegacyQuery::getAllConstants().","Omit status (or send it empty) to match all revisions and filter client-side.","Migrate to differential.revision.search, which accepts modern status values."],"exampleFix":"// before\n$params['status'] = 'open';\n$client->callMethodSynchronous('differential.query', $params);\n\n// after\n$params['status'] = 'status-open';\n$client->callMethodSynchronous('differential.query', $params);","handlingStrategy":"validation","validationCode":"$legacy_statuses = DifferentialLegacyQuery::getAllConstants(); // or a literal list\nif ($status !== null && $status !== '' &&\n    !in_array($status, $legacy_statuses, true)) {\n  throw new InvalidArgumentException(\n    'Unknown legacy status filter: '.$status);\n}","typeGuard":"function isLegacyStatus($value, array $allowed) {\n  return $value === null || $value === '' || in_array($value, $allowed, true);\n}","tryCatchPattern":"try {\n  $revisions = $client->callMethodSynchronous('differential.query', $params);\n} catch (Exception $ex) {\n  if (strpos($ex->getMessage(), 'status filter constant') !== false) {\n    // fix the status constant or drop the status parameter and filter client-side\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Use the documented legacy constants ('status-any', 'status-open', ...) or omit status.","Migrate to differential.revision.search for modern status values.","Never forward modern status names into differential.query."],"tags":["phabricator","conduit","differential","status-filter","legacy-api"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}