octobercms/october · error · Error

Changes can only be reverted in live mode.

Error message

Changes can only be reverted in live mode.

What it means

State-contract error in the Inspector's revertChanges: the revert/cancel action was invoked while the component is not in live mode. In non-live (deferred) mode changes never touched the live object, so there is nothing to revert — reverting is implemented by restoring originalData and only makes sense for live-mode editors.

Solutions

  1. Only expose the revert action when the Inspector runs in live mode
  2. In deferred mode, simply discard the component state instead of calling revertChanges
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/vuecomponents/inspector/assets/js/inspector.js:105 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/918f884d42f8f029. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/inspector/assets/js/inspector.js:105

                    }
                }

                // Implicit: strip if value matches the defined default
                if (control.default !== undefined && utils.compareValues(value, control.default)) {
                    utils.deleteProperty(result, control.property);
                }
            });

            return result;
        },

        applyChanges: function applyChanges() {
            utils.deepCloneObject(this.getCleanObject(), this.data.obj);
        },

        revertChanges: function cancelChanges() {
            if (!this.liveMode) {
                throw new Error('Changes can only be reverted in live mode.');
            }

            utils.deepCloneObject(this.originalData, this.data.obj);
        },

        validate: function validate() {
            return this.$refs.panel.validate();
        },

        onModalShown: function onModalShown() {
            this.layoutUpdateData.modalShown++;
        }
    },
    created: function created() {
        var validationError = utils.validateDataSchema(this.dataSchema);

        if (typeof validationError === 'string') {
            console.log(this.dataSchema);

View on GitHub (pinned to b608633a7e)