{"record":{"id":"9b73537225d951c7","repo":"phacility/phabricator","slug":"parameter-s-must-contain-a-list-of-transaction-9b7353","errorCode":null,"errorMessage":"Parameter \"%s\" must contain a list of transaction descriptions, but item with key \"%s\" is missing a \"type\" field. Each transaction must have a type field.","messagePattern":"Parameter \"(.+?)\" must contain a list of transaction descriptions, but item with key \"(.+?)\" is missing a \"type\" field\\. Each transaction must have a type field\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngine.php","lineNumber":2207,"sourceCode":"    if (!is_array($xactions)) {\n      throw new Exception(\n        pht(\n          'Parameter \"%s\" is not a list of transactions.',\n          $transactions_key));\n    }\n\n    foreach ($xactions as $key => $xaction) {\n      if (!is_array($xaction)) {\n        throw new Exception(\n          pht(\n            'Parameter \"%s\" must contain a list of transaction descriptions, '.\n            'but item with key \"%s\" is not a dictionary.',\n            $transactions_key,\n            $key));\n      }\n\n      if (!array_key_exists('type', $xaction)) {\n        throw new Exception(\n          pht(\n            'Parameter \"%s\" must contain a list of transaction descriptions, '.\n            'but item with key \"%s\" is missing a \"type\" field. Each '.\n            'transaction must have a type field.',\n            $transactions_key,\n            $key));\n      }\n\n      if (!array_key_exists('value', $xaction)) {\n        throw new Exception(\n          pht(\n            'Parameter \"%s\" must contain a list of transaction descriptions, '.\n            'but item with key \"%s\" is missing a \"value\" field. Each '.\n            'transaction must have a value field.',\n            $transactions_key,\n            $key));\n      }\n    }","sourceCodeStart":2189,"sourceCodeEnd":2225,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngine.php#L2189-L2225","documentation":"Each entry of the Conduit 'transactions' list must be a dictionary with at least a 'type' key naming the transaction type (e.g. 'title', 'priority'). getRawConduitTransactions() throws this when an item is a dictionary but has no 'type' field.","triggerScenarios":"Sending transactions => [{\"value\":\"x\"}] (value only), or using a different key name such as 'transaction', 'action', or 'operation' instead of 'type'.","commonSituations":"Porting scripts from the older pre-edit-engine API (maniphest.update used 'type' at the top level with different semantics); guessing field names instead of copying them from the method documentation; typos like 'Type' (case-sensitive).","solutions":["Add a 'type' key to every transaction dictionary, e.g. {\"type\":\"title\",\"value\":\"x\"}","Use exact lowercase type keys from the method docs or the error listing ('title', 'description', 'priority', 'owner', 'projects', 'subscribers', 'comment', ...)","Validate the shape client-side: every element has both 'type' and 'value'"],"exampleFix":"// before\n'transactions' => array(array('action' => 'title', 'value' => 'x')),\n// Exception: ... item with key \"0\" is missing a \"type\" field.\n\n// after\n'transactions' => array(array('type' => 'title', 'value' => 'x')),","handlingStrategy":"validation","validationCode":"foreach ($parameters['transactions'] as $i => $txn) {\n  if (!isset($txn['type'])) {\n    // reject before send: every transaction needs 'type'\n  }\n}","typeGuard":"function hasRequiredTransactionKeys(array $txn) {\n  return isset($txn['type']) && array_key_exists('value', $txn);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('maniphest.edit', $parameters);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'missing a \"type\" field') !== false) {\n    // add the type key; the failing index is in the message\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Copy type keys verbatim from the method documentation; they are lowercase","Construct transactions only through a helper that enforces type+value keys","When porting old maniphest.update scripts, rewrite the payload shape, not just the method name"],"tags":["phabricator","conduit","request-validation","missing-field","php"],"backgroundTag":"invalid-request-payload","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}