{"record":{"id":"3258b38cd7cf9efc","repo":"phacility/phabricator","slug":"the-objects-you-have-listed-include-objects-of-the","errorCode":null,"errorMessage":"The objects you have listed include objects of the wrong type (%s) and objects which do not exist (%s).","messagePattern":"The objects you have listed include objects of the wrong type \\((.+?)\\) and objects which do not exist \\((.+?)\\)\\.","errorType":"validation","errorClass":"DifferentialFieldParseException","httpStatus":null,"severity":"error","filePath":"src/applications/phid/query/PhabricatorObjectListQuery.php","lineNumber":178,"sourceCode":"    // revision author does not have permission to see are added by Herald\n    // rules. Any actual edits will be checked later: users are not allowed\n    // to add new reviewers they can't see, but they can touch a field which\n    // contains them.\n    foreach ($missing as $key => $value) {\n      if (isset($allowed[phid_get_type($value)])) {\n        unset($missing[$key]);\n        $result[$key] = $value;\n      }\n    }\n\n    // NOTE: We could couple this less tightly with Differential, but it is\n    // currently the only thing that uses it, and we'd have to add a lot of\n    // extra API to loosen this. It's not clear that this will be useful\n    // elsewhere any time soon, so let's cross that bridge when we come to it.\n\n    if (!$this->getAllowPartialResults()) {\n      if ($invalid && $missing) {\n        throw new DifferentialFieldParseException(\n          pht(\n            'The objects you have listed include objects of the wrong '.\n            'type (%s) and objects which do not exist (%s).',\n            implode(', ', $invalid),\n            implode(', ', $missing)));\n      } else if ($invalid) {\n        throw new DifferentialFieldParseException(\n          pht(\n            'The objects you have listed include objects of the wrong '.\n            'type (%s).',\n            implode(', ', $invalid)));\n      } else if ($missing) {\n        throw new DifferentialFieldParseException(\n          pht(\n            'The objects you have listed include objects which do not '.\n            'exist (%s).',\n            implode(', ', $missing)));\n      }","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phid/query/PhabricatorObjectListQuery.php#L160-L196","documentation":"PhabricatorObjectListQuery resolves a list of object references (monikers/PHIDs/usernames) for fields such as Differential reviewers or subscribers. When partial results are disallowed (getAllowPartialResults() false, the default) and some references resolved to objects of the wrong type ($invalid) while others resolved to nothing ($missing), it throws DifferentialFieldParseException naming both sets. This fires while parsing/validating a Differential field value before it is saved.","triggerScenarios":"Setting Reviewers to something like 'alice, D123, bob-notexistent' where D123 is a revision (wrong type) and the last entry matches no user; custom fields built on PhabricatorObjectListQuery with a single expected object type receiving mixed input; API clients sending PHID-TASK-/PHID-DIFF- values into a users-only field.","commonSituations":"Pasting comma-separated lists where a monogram or PHID slips in; typos in usernames; renamed/deleted users in saved templates; migration scripts replaying old field values.","solutions":["Remove or correct both the wrong-type entries and the nonexistent entries named in the message","Use only references valid for that field - usernames, @usernames, or PHID-USER-* for user lists","Programmatic callers that can tolerate drops should call setAllowPartialResults(true) on the query"],"exampleFix":"// before: reviewers = \"alice, D123, charlie-noexist\"\n// after: reviewers = \"alice\"  // drop the revision monogram and the unknown username","handlingStrategy":"validation","validationCode":"// Dry-run the list resolution before saving the field\n$check = id(new PhabricatorObjectListQuery())\n  ->setViewer($viewer)\n  ->setObjectList($raw_value)\n  ->setAllowedTypes(array('PHID-USER'))\n  ->execute();\nif (count($check) !== count(explode(',', $raw_value))) {\n  // some refs are wrong-type or nonexistent; show a field error instead of saving\n}","typeGuard":null,"tryCatchPattern":"try {\n  $result = $list_query->execute();\n} catch (DifferentialFieldParseException $ex) {\n  // surface $ex->getMessage() as a validation error on the form field\n  $field_error = $ex->getMessage();\n}","preventionTips":["Validate object lists (PhabricatorObjectListQuery) before persisting Differential fields","Accept only monikers/PHIDs of the field's expected type","Catch DifferentialFieldParseException in form handling and render it as a field error"],"tags":["phabricator","differential","field-validation","object-list","phid"],"backgroundTag":"reference-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}