{"record":{"id":"fc3f7cc1aa0bcb37","repo":"phacility/phabricator","slug":"field-slug-must-be-non-empty-fc3f7c","errorCode":null,"errorMessage":"Field \"slug\" must be non-empty.","messagePattern":"Field \"slug\" must be non-empty\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php","lineNumber":42,"sourceCode":"    return array(\n      'slug' => 'required string',\n    );\n  }\n\n  protected function defineReturnType() {\n    return 'nonempty list';\n  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR-BAD-DOCUMENT' => pht('No such document exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $slug = $request->getValue('slug');\n    if ($slug === null || !strlen($slug)) {\n      throw new Exception(pht('Field \"slug\" must be non-empty.'));\n    }\n\n    $doc = id(new PhrictionDocumentQuery())\n      ->setViewer($request->getUser())\n      ->withSlugs(array(PhabricatorSlug::normalize($slug)))\n      ->executeOne();\n    if (!$doc) {\n      throw new ConduitException('ERR-BAD-DOCUMENT');\n    }\n\n    $content = id(new PhrictionContent())->loadAllWhere(\n      'documentID = %d ORDER BY version DESC',\n      $doc->getID());\n\n    $results = array();\n    foreach ($content as $version) {\n      $results[] = $this->buildDocumentContentDictionary(\n        $doc,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php#L24-L60","documentation":"The phriction.history Conduit method requires the slug field to locate the document whose content versions will be listed; execute() rejects a null or zero-length slug before any query runs. It surfaces to clients as a generic Conduit error because a plain Exception is used.","triggerScenarios":"Calling conduit method phriction.history with slug omitted, null, or the empty string.","commonSituations":"History-export scripts where the slug list contains blanks; iterating over rows from another system where some paths failed to map to slugs.","solutions":["Pass a non-empty document slug in the call parameters","Filter or validate slug lists before iterating them into phriction.history calls","Fall back to phriction.info on the same slug to verify resolvability when debugging"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$slug = (string)idx($params, 'slug', '');\nif ($slug === '') {\n  throw new InvalidArgumentException('phriction.history: slug must be non-empty');\n}\n$result = $client->callMethodSynchronous('phriction.history', $params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter blank slugs out of batch history pulls before calling","Validate slug provenance when importing path lists from other systems","Wrap conduit helpers with required-parameter assertions"],"tags":["phabricator","phriction","conduit","slug","history","input-validation"],"backgroundTag":"required-field-empty","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}