{"record":{"id":"8719b537f082b674","repo":"phacility/phabricator","slug":"unknown-field-property-view-style-s-valid-styl","errorCode":null,"errorMessage":"Unknown field property view style '%s'; valid styles are '%s' and '%s'.","messagePattern":"Unknown field property view style '(.+?)'; valid styles are '(.+?)' and '(.+?)'\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/customfield/field/PhabricatorCustomFieldList.php","lineNumber":128,"sourceCode":"    }\n\n    // Move all the blocks to the end, regardless of their configuration order,\n    // because it always looks silly to render a block in the middle of a list\n    // of properties.\n    $head = array();\n    $tail = array();\n    foreach ($fields as $key => $field) {\n      $style = $field->getStyleForPropertyView();\n      switch ($style) {\n        case 'property':\n        case 'header':\n          $head[$key] = $field;\n          break;\n        case 'block':\n          $tail[$key] = $field;\n          break;\n        default:\n          throw new Exception(\n            pht(\n              \"Unknown field property view style '%s'; valid styles are \".\n              \"'%s' and '%s'.\",\n              $style,\n              'block',\n              'property'));\n      }\n    }\n    $fields = $head + $tail;\n\n    $add_header = null;\n\n    $phids = array();\n    foreach ($fields as $key => $field) {\n      $phids[$key] = $field->getRequiredHandlePHIDsForPropertyView();\n    }\n\n    $all_phids = array_mergev($phids);","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php#L110-L146","documentation":"Thrown while building an object's property view (the detail-page panel) when a custom field's getStyleForPropertyView() returns a value other than 'property', 'header' or 'block'. PhabricatorCustomFieldList uses the style to split fields into the head section ('property'/'header') and the tail section ('block'); any unrecognized string aborts rendering with this exception. It is almost always a bug in a custom field class (yours or an extension's), not in Phabricator core.","triggerScenarios":"A PhabricatorCustomField subclass overrides getStyleForPropertyView() and returns a typo'd or invented value (e.g. 'sidebar', 'full', 'propery'), or returns a constant that evaluates to something unexpected. The exception fires the moment any object carrying that field renders its property list — e.g. opening a Maniphest task or other object detail page with custom fields attached.","commonSituations":"Custom field classes registered via the custom-fields extension mechanism with a misspelled style string; third-party extension libraries that drifted from core after the style API changed; copy-pasting an old field implementation into a newer Phabricator.","solutions":["Open the failing field class and check what getStyleForPropertyView() returns; it must be exactly 'property', 'header' or 'block'.","If no special placement is needed, delete the override so the parent default applies.","Search extensions/ and your PhabricatorCustomField subclasses for the bad string shown in the exception to find the offending class.","After fixing, clear caches and reload the object's detail page."],"exampleFix":"// before\npublic function getStyleForPropertyView() {\n  return 'sidebar';\n}\n\n// after\npublic function getStyleForPropertyView() {\n  return 'block';\n}","handlingStrategy":"type-guard","validationCode":"$allowed = array('property', 'header', 'block');\n$style = $field->getStyleForPropertyView();\nif (!in_array($style, $allowed, true)) {\n  // skip or log the field before it reaches PhabricatorCustomFieldList\n}","typeGuard":"function is_valid_property_view_style($style) {\n  $valid = array('property', 'header', 'block');\n  return is_string($style) && in_array($style, $valid, true);\n}","tryCatchPattern":"try {\n  $this->appendPropertyList($fields);\n} catch (Exception $ex) {\n  // log and render the page without the custom field panels\n}","preventionTips":["Treat the style set as a closed enum: 'property', 'header', 'block'.","Add a unit test per custom field asserting getStyleForPropertyView() returns a member of the enum.","Re-run those tests after every Phabricator or extension upgrade."],"tags":["phabricator","custom-fields","property-view","php","rendering"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}