octobercms/october · error · SystemException

Drag and drop is not supported for treeview branches with…

Error message

Drag and drop is not supported for treeview branches with enabled Group By feature

What it means

State-conflict validation in NodeDefinition::setDragAndDropMode: drag and drop was requested but the branch already has a groupBy property set. Grouped (folder) branches render synthetic folder nodes whose ordering is derived from grouping, so node DnD is not supported for them.

Solutions

  1. Disable grouping (do not call setGroupBy) for branches that need drag and drop
  2. Skip setDragAndDropMode for grouped branches
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/vuecomponents/treeview/NodeDefinition.php:318 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/ccaeabf5d0b85196. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/treeview/NodeDefinition.php:318

    /**
     * Sets tree branch drag and drop mode - sort, move (or both), or custom.
     * Only the root node drag and drop mode is considered.
     */
    public function setDragAndDropMode(array $mode)
    {
        foreach ($mode as $option) {
            if (!in_array($option, [self::DND_MOVE, self::DND_SORT, self::DND_CUSTOM, self::DND_CUSTOM_EXTERNAL])) {
                throw new SystemException('Invalid treeview branch drag and drop mode: '.$option);
            }

            if ($option === self::DND_CUSTOM && count($mode) > 1) {
                throw new SystemException('Treeview branch drag and drop Custom mode cannot be combined with other modes');
            }
        }

        if ($this->groupBy) {
            throw new SystemException('Drag and drop is not supported for treeview branches with enabled Group By feature');
        }

        $this->dragAndDropMode = $mode;

        return $this;
    }

    /**
     * Sets optional grouping for a tree branch.
     * Applies to root nodes only. Allows to group
     * child nodes using a userData object property.
     * Supported for the list display mode only.
     */
    public function setGroupBy(string $property)
    {
        if ($this->displayMode != NodeDefinition::DISPLAY_MODE_LIST) {
            throw new SystemException('Treeview branch grouping is only supported for the LIST display mode');
        }

View on GitHub (pinned to b608633a7e)