octobercms/october · error · SystemException
Invalid tree display mode
Error message
Invalid tree display mode: {} What it means
Validation in NodeDefinition::setDisplayMode: the requested display mode string is neither DISPLAY_MODE_TREE nor DISPLAY_MODE_LIST. Only those two modes exist for treeview branch rendering, and only the root node's mode is meaningful, so anything else is a programmer error in the treeview definition.
Solutions
- Call setDisplayMode with NodeDefinition::DISPLAY_MODE_TREE or DISPLAY_MODE_LIST
- Check for typos or dynamically built mode strings that produce an invalid value
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/vuecomponents/treeview/NodeDefinition.php:141 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/a4b710b94782f78f.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/vuecomponents/treeview/NodeDefinition.php:141
protected $hideInQuickAccess = false;
/**
* __construct
*/
public function __construct(string $label, string $key)
{
$this->label = $label;
$this->key = $key;
}
/**
* Sets tree branch display mode - tree or list.
* Only the root node display mode is considered.
*/
public function setDisplayMode(string $value)
{
if (!in_array($value, [self::DISPLAY_MODE_TREE, self::DISPLAY_MODE_LIST])) {
throw new SystemException('Invalid tree display mode: '.$value);
}
if ($this->groupBy) {
throw new SystemException('Treeview branch grouping is only supported for the LIST display mode');
}
$this->displayMode = $value;
return $this;
}
/**
* Determines whether multiple nodes can be selected.
* Only the root node property value is considered.
*/
public function setMultiSelect(bool $value)
{
$this->multiSelect = $value;View on GitHub (pinned to b608633a7e)