{"record":{"id":"7585dbb19075b4f7","repo":"phacility/phabricator","slug":"parameter-s-must-contain-a-list-of-transaction","errorCode":null,"errorMessage":"Parameter \"%s\" must contain a list of transaction descriptions, but item with key \"%s\" is not a dictionary.","messagePattern":"Parameter \"(.+?)\" must contain a list of transaction descriptions, but item with key \"(.+?)\" is not a dictionary\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngine.php","lineNumber":2198,"sourceCode":"      ),\n      'transactions' => $xactions_struct,\n    );\n  }\n\n  private function getRawConduitTransactions(ConduitAPIRequest $request) {\n    $transactions_key = 'transactions';\n\n    $xactions = $request->getValue($transactions_key);\n    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)) {","sourceCodeStart":2180,"sourceCodeEnd":2216,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngine.php#L2180-L2216","documentation":"Once the 'transactions' parameter is an array, getRawConduitTransactions() iterates it and requires every element to itself be an array (a dictionary describing one transaction). This exception is thrown when an item is a scalar, e.g. a string or integer.","triggerScenarios":"Sending transactions => [\"title\"] or transactions => [\"title\", \"x\"] instead of transactions => [{\"type\":\"title\",\"value\":\"x\"}]; mixing a bare string into an otherwise correct list.","commonSituations":"Shorthand attempts to use compact type strings; merging user input or CLI argv entries directly into the transactions list; template engines producing flat arrays of strings.","solutions":["Give every element both a 'type' key and a 'value' key: [{\"type\":\"...\",\"value\":...}]","Validate the payload shape client-side before the call (every element is a dict)","Map any shorthand strings to full dictionaries in a helper before sending"],"exampleFix":"// before\n'transactions' => array('title', 'Fix login bug'),\n// Exception: ... item with key \"0\" is not a dictionary.\n\n// after\n'transactions' => array(\n  array('type' => 'title', 'value' => 'Fix login bug'),\n),","handlingStrategy":"validation","validationCode":"foreach ($parameters['transactions'] as $i => $txn) {\n  if (!is_array($txn)) {\n    throw new InvalidArgumentException(\n      sprintf('transactions[%d] must be a dict with type+value', $i));\n  }\n}","typeGuard":"function isTransactionDict($txn) {\n  return is_array($txn)\n    && isset($txn['type'])\n    && array_key_exists('value', $txn);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('maniphest.edit', $parameters);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'is not a dictionary') !== false) {\n    // the offending index is named in the message; fix that element\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Map shorthand strings ('title') to full dicts in one helper before sending","Never splice raw CLI argv or user strings into the transactions list","Keep a canonical example payload in tests as the shape contract"],"tags":["phabricator","conduit","request-validation","payload-shape","php"],"backgroundTag":"invalid-request-payload","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}