octobercms/october · error · Error

Property is not defined in userData of

Error message

Property {} is not defined in userData of {}

What it means

Thrown inside the sort comparator of treeview utils.sortNodes when a node's userData lacks one of the properties from the sort query (node1Prop === undefined during comparison of two non-folder nodes). The sortBy configuration names a key that at least one participating node does not define.

Solutions

  1. Ensure all nodes define every property used in the sortBy query string
  2. Remove the offending property from setSortBy, or default it (e.g. empty string) when constructing nodes
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/vuecomponents/treeview/assets/js/classes/utils.js:416 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/c4e6e8fda6143c48. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/treeview/assets/js/classes/utils.js:416

            }

            for (var index = 0; index < sortProperties.length; index++) {
                var propertyParts = sortProperties[index],
                    node1Prop = node1.userData[propertyParts.property],
                    node2Prop = node2.userData[propertyParts.property],
                    cmpResult = 0;

                if (node1Prop === undefined) {
                    throw new Error(
                        'Unable to sort treeview nodes. Property ' +
                            propertyParts.property +
                            ' is not defined in userData of ' +
                            node1.label
                    );
                }

                if (node2Prop === undefined) {
                    throw new Error(
                        'Property ' + propertyParts.property + ' is not defined in userData of ' + node2.label
                    );
                }

                if (typeof node1Prop === 'string') {
                    cmpResult = self.compareStrings(node1Prop, node2Prop, propertyParts.invertor);
                }
                else {
                    cmpResult = self.compareAnything(node1Prop, node2Prop, propertyParts.invertor);
                }

                if (cmpResult !== 0) {
                    return cmpResult;
                }
            }
        });
    }

View on GitHub (pinned to b608633a7e)