phacility/phabricator · error · Exception
Unknown field property view style '%s'; valid styles are '%s
Error message
Unknown field property view style '%s'; valid styles are '%s' and '%s'.
What it means
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.
Source
Thrown at src/infrastructure/customfield/field/PhabricatorCustomFieldList.php:128
}
// Move all the blocks to the end, regardless of their configuration order,
// because it always looks silly to render a block in the middle of a list
// of properties.
$head = array();
$tail = array();
foreach ($fields as $key => $field) {
$style = $field->getStyleForPropertyView();
switch ($style) {
case 'property':
case 'header':
$head[$key] = $field;
break;
case 'block':
$tail[$key] = $field;
break;
default:
throw new Exception(
pht(
"Unknown field property view style '%s'; valid styles are ".
"'%s' and '%s'.",
$style,
'block',
'property'));
}
}
$fields = $head + $tail;
$add_header = null;
$phids = array();
foreach ($fields as $key => $field) {
$phids[$key] = $field->getRequiredHandlePHIDsForPropertyView();
}
$all_phids = array_mergev($phids);View on GitHub (pinned to 5720a38cfe)
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.
Example fix
// before
public function getStyleForPropertyView() {
return 'sidebar';
}
// after
public function getStyleForPropertyView() {
return 'block';
} Defensive patterns
Strategy: type-guard
Validate before calling
$allowed = array('property', 'header', 'block');
$style = $field->getStyleForPropertyView();
if (!in_array($style, $allowed, true)) {
// skip or log the field before it reaches PhabricatorCustomFieldList
} Type guard
function is_valid_property_view_style($style) {
$valid = array('property', 'header', 'block');
return is_string($style) && in_array($style, $valid, true);
} Try / catch
try {
$this->appendPropertyList($fields);
} catch (Exception $ex) {
// log and render the page without the custom field panels
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Custom field class "%s" does not exist.
- Custom field class "%s" does not implement interface "%s".
- No custom field role specified.
- No custom field key specified.
- No field with field key "%s" exists for objects of class "%s
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/8719b537f082b674.
Report an issue: GitHub.