octobercms/october · error · Error

The ignoreIfDefault feature cannot be used without the…

Error message

The ignoreIfDefault feature cannot be used without the default property value.

What it means

Raised while the Surface assembles its values when a property declares ignoreIfDefault but defines no default value. The feature compares the current value against a default, so its absence makes the option meaningless; the property configuration itself is at fault.

Solutions

  1. Add a 'default' value to the property definition that uses ignoreIfDefault
  2. Remove the ignoreIfDefault option if no default is intended
  3. Verify the property definition merges correctly and isn't dropping the default key
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/assets/foundation/controls/inspector/inspector.surface.js:863 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/aad2ba41691e92e7. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/assets/foundation/controls/inspector/inspector.surface.js:863

                    }
                    else {
                        value = property.default
                    }
                }

                if (value === $.oc.inspector.removedProperty) {
                    continue
                }

                if (property.ignoreIfEmpty !== undefined && (property.ignoreIfEmpty === true || property.ignoreIfEmpty === "true") && editor) {
                    if (editor.isEmptyValue(value)) {
                        continue
                    }
                }

                if (property.ignoreIfDefault !== undefined && (property.ignoreIfDefault === true || property.ignoreIfDefault === "true") && editor) {
                    if (property.default === undefined) {
                        throw new Error('The ignoreIfDefault feature cannot be used without the default property value.')
                    }

                    if (this.comparePropertyValues(value, property.default)) {
                        continue
                    }
                }
            }
            else {
                value = externalParameterEditor.getValue()
                value = '{{ ' + value + ' }}'
            }

            result[property.property] = value
        }

        return result
    }

View on GitHub (pinned to b608633a7e)