{"record":{"id":"d5970006e6267400","repo":"phacility/phabricator","slug":"subtype-configuration-is-invalid-it-must-be-a-lis","errorCode":null,"errorMessage":"Subtype configuration is invalid: it must be a list of subtype specifications.","messagePattern":"Subtype configuration is invalid: it must be a list of subtype specifications\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php","lineNumber":150,"sourceCode":"      throw new Exception(\n        pht(\n          'Subtype \"%s\" is not valid: subtype keys must have a minimum '.\n          'length of 3 bytes.',\n          $subtype));\n    }\n\n    if (!preg_match('/^[a-z]+\\z/', $subtype)) {\n      throw new Exception(\n        pht(\n          'Subtype \"%s\" is not valid: subtype keys may only contain '.\n          'lowercase latin letters (\"a\" through \"z\").',\n          $subtype));\n    }\n  }\n\n  public static function validateConfiguration($config) {\n    if (!is_array($config)) {\n      throw new Exception(\n        pht(\n          'Subtype configuration is invalid: it must be a list of subtype '.\n          'specifications.'));\n    }\n\n    $map = array();\n    foreach ($config as $value) {\n      PhutilTypeSpec::checkMap(\n        $value,\n        array(\n          'key' => 'string',\n          'name' => 'string',\n          'tag' => 'optional string',\n          'color' => 'optional string',\n          'icon' => 'optional string',\n          'children' => 'optional map<string, wild>',\n          'fields' => 'optional map<string, wild>',\n          'mutations' => 'optional list<string>',","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php#L132-L168","documentation":"PhabricatorEditEngineSubtype::validateConfiguration() starts by requiring the subtype configuration value itself to be a PHP list (array of subtype specification dictionaries). This exception fires when the config is not an array at all — a string, map, or scalar — i.e. the whole shape is wrong before any individual subtype is inspected.","triggerScenarios":"Setting maniphest.subtypes (or the engine's subtype config) to a JSON object keyed by subtype ({\"bug\": {...}}), a string, or leaving a placeholder scalar instead of a JSON list [{...}, {...}].","commonSituations":"Hand-editing raw config JSON and using a map because it reads nicer; pasting YAML-style mappings; misunderstanding that the container must be a list with 'key' inside each entry.","solutions":["Make the top-level value a JSON list of dictionaries, each carrying its own \"key\" field","Start from the documented example config (a list containing at least the \"default\" subtype) and extend it","Re-save through the config editor and re-read the stored value to confirm it is a list"],"exampleFix":"// before\n{\n  \"bug\":     { \"name\": \"Bug\" },\n  \"feature\": { \"name\": \"Feature\" }\n}\n// Exception: Subtype configuration is invalid: it must be a list ...\n\n// after\n[\n  { \"key\": \"default\", \"name\": \"Default\" },\n  { \"key\": \"bug\", \"name\": \"Bug\" },\n  { \"key\": \"feature\", \"name\": \"Feature\" }\n]","handlingStrategy":"validation","validationCode":"if (!is_array($config) || $config !== array_values($config)) {\n  // reject before saving: config must be a LIST of subtype dicts\n}","typeGuard":"function isSubtypeConfigList($config) {\n  return is_array($config)\n    && $config === array_values($config)\n    && array_filter($config, 'is_array') === $config;\n}","tryCatchPattern":null,"preventionTips":["Start from the documented example list and extend, rather than authoring JSON from scratch","Each entry carries its own \"key\"; never key the top level by subtype","Re-read the saved config after writing to confirm the stored shape is a list"],"tags":["phabricator","subtypes","config-validation","payload-shape","php"],"backgroundTag":"config-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}