{"record":{"id":"f262aaaf3de374ac","repo":"phacility/phabricator","slug":"owner-rule-value-must-have-only-one-elmement-valu","errorCode":null,"errorMessage":"Owner rule value must have only one elmement (value is \"%s\").","messagePattern":"Owner rule value must have only one elmement \\(value is \"(.+?)\"\\)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php","lineNumber":42,"sourceCode":"  protected function assertValidRuleRecordFormat($value) {\n    if (!is_array($value)) {\n      throw new Exception(\n        pht(\n          'Owner rule value should be a list, but is not (value is \"%s\").',\n          phutil_describe_type($value)));\n    }\n  }\n\n  protected function assertValidRuleRecordValue($value) {\n    if (!$value) {\n      throw new Exception(\n        pht(\n          'Owner rule value is required. Specify a user to assign tasks '.\n          'to, or the token \"none()\" to unassign tasks.'));\n    }\n\n    if (count($value) > 1) {\n      throw new Exception(\n        pht(\n          'Owner rule value must have only one elmement (value is \"%s\").',\n          implode(', ', $value)));\n    }\n\n    $owner_phid = $this->convertTokenizerValueToOwner($value);\n    if ($owner_phid !== null) {\n      $user = id(new PhabricatorPeopleQuery())\n        ->setViewer($this->getViewer())\n        ->withPHIDs(array($owner_phid))\n        ->executeOne();\n      if (!$user) {\n        throw new Exception(\n          pht(\n            'User PHID (\"%s\") is not a valid user.',\n            $owner_phid));\n      }\n    }","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php#L24-L60","documentation":"Thrown by assertValidRuleRecordValue() for the 'task.owner' rule when the value list contains more than one entry. The rule models a single owner, so after the empty check it enforces count($value) == 1. (Upstream message contains the typo 'elmement'.) This is save-time validation via getRuleRecordValueValidationException().","triggerScenarios":"A task.owner rule whose value array holds 2+ PHIDs, e.g. ['PHID-USER-a','PHID-USER-b'] — typically from a hand-edited record, an import script, or a client that reused an 'Add Projects' style value for the owner rule. Saving or re-validating the trigger throws.","commonSituations":"Copy-paste of an 'add projects' value shape into an owner rule; migration tooling that mapped a multi-owner field onto the single-owner rule; direct DB writes.","solutions":["Edit the trigger so the owner field contains exactly one entry: one user PHID or the token none().","Repair the stored record to a one-element array if the editor cannot open it.","Fix import/migration code to pick a single owner for task.owner rules (they cannot hold a list).","Split conflicting requirements into separate columns/triggers, since each drop applies one owner."],"exampleFix":"// before\n$value = array('PHID-USER-a', 'PHID-USER-b');\n\n// after\n$value = array('PHID-USER-a');","handlingStrategy":"validation","validationCode":"if (count($value) > 1) {\n  throw new Exception('Owner rule accepts exactly one value; got '.count($value));\n}","typeGuard":"function isSingleOwnerValue($value) {\n  return is_array($value) && count($value) === 1;\n}","tryCatchPattern":"$ex = $rule->getRuleRecordValueValidationException();\nif ($ex) { /* render message in editor; keep first value only */ }","preventionTips":["Remember task.owner is single-valued even though the UI control looks like a tokenizer.","When importing, enforce count===1 before writing owner rule records.","Do not reuse add-projects value arrays for owner rules."],"tags":["php","phabricator","project-triggers","form-validation","cardinality"],"backgroundTag":"single-value-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}