octobercms/october · error · Error

${errorMessage} Property: ${this.propertyDefinition.property

Error message

${errorMessage} Property: ${this.propertyDefinition.property}

What it means

In capture mode (`{% put name %}` without `=`), PutTokenParser only accepts bare NAME tokens as options between the target name and the block end — anything else (a quoted string, a number, an operator) reaches the else branch and throws this SyntaxError. The line number in the message comes from the token that started the `{% put %}` tag.

Source

Thrown at modules/backend/assets/foundation/controls/inspector/inspector.editor.base.js:128

    }

    /**
     * Updates displayed value in the editor UI. The value is already set
     * in the Inspector and should be loaded from Inspector.
     */
    BaseEditor.prototype.updateDisplayedValue = function(value) {
    }

    BaseEditor.prototype.getPropertyName = function() {
        return this.propertyDefinition.property
    }

    BaseEditor.prototype.getUndefinedValue = function() {
        return this.propertyDefinition.default === undefined ? undefined : this.propertyDefinition.default
    }

    BaseEditor.prototype.throwError = function(errorMessage) {
        throw new Error(errorMessage + ' Property: ' + this.propertyDefinition.property)
    }

    BaseEditor.prototype.getInspectableElement = function() {
        return this.getRootSurface().getInspectableElement()
    }

    BaseEditor.prototype.isEmptyValue = function(value) {
        return value === undefined
            || value === null
            || (typeof value == 'object' && $.isEmptyObject(value) )
            || (typeof value == 'string' && $.trim(value).length === 0)
            || (Object.prototype.toString.call(value) === '[object Array]' && value.length === 0)
    }

    //
    // Validation
    //

View on GitHub (pinned to b608633a7e)

Solutions

  1. Remove the offending token — capture-mode options must be unquoted single words (NAME tokens), e.g. `{% put sidebar %}`.
  2. If you meant to assign a value, use assignment mode: `{% put sidebar = 'left' %}`.
  3. Pass configuration inside the body instead of the tag arguments when it is not a bare word.

Example fix

// before
{% put sidebar 'left' %}<nav>...</nav>{% endput %}

// after
{% put sidebar %}<nav>...</nav>{% endput %}
Defensive patterns

Strategy: try-catch

Validate before calling

// Lint: in capture mode only bare word options are allowed before %}
if (preg_match('/{%-?\s*put\s+[\w]+\s+[^%\w\s-][^%]*%-?}/', $template)) {
    throw new RuntimeException('Non-word token in {% put %} tag arguments');
}

Try / catch

try {
    $twig->load($template);
} catch (Twig\Error\SyntaxError $e) {
    // 'Invalid syntax in the put tag. Line N' — inspect that line for quoted/stray tokens
    throw $e;
}

Prevention

When it happens

Trigger: Writing `{% put sidebar 'left' %}` or `{% put sidebar = 'left' %}` with a stray trailing token after the option loop; any quoted literal or number where a bare option word is expected before `{% endput %}`-style capture begins.

Common situations: Trying to pass a mode/argument to the captured block, e.g. `{% put sidebar default %}` is fine but `{% put sidebar 'default' %}` fails; hand-editing and leaving punctuation behind.

Related errors


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/4b1f48af1ffe3eda. Report an issue: GitHub.