octobercms/october · error · ValidationException

Missing type!

Error message

Missing type!

What it means

Error "Missing type!" thrown in octobercms/october.

Source

Thrown at modules/cms/widgets/PageLookup.php:164

    }

    /**
     * onInsertReference
     */
    public function onInsertReference()
    {
        // Disable asset broadcasting
        $this->controller->flushAssets();

        $widget = $this->getSelectFormWidget();

        $data = $widget->getSaveData();
        $type = array_pull($data, 'type', '');
        $reference = array_pull($data, 'reference', '');

        // Validate
        if (!$type) {
            throw new ValidationException(['type' => 'Missing type!']);
        }

        if (!$widget->getField('cms_page')->hidden && !isset($data['cms_page'])) {
            throw new ValidationException(['cms_page' => __('Please select a CMS page')]);
        }

        if (!$widget->getField('reference')->hidden && !$widget->getField('reference')->disabled && !$reference) {
            throw new ValidationException(['reference' => __('Please select a page reference')]);
        }

        if ($type === 'url' && (!isset($data['url']) || !PageLookupItem::isValidUrl($data['url']))) {
            throw new ValidationException(['reference' => __('Please enter a valid URL')]);
        }

        // Determine reference title
        $model = $widget->model;
        $model->type = $type;
        $model->reference = $reference;

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/cms/widgets/PageLookup.php:164 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/e1cd5d395bf15e5c. Report an issue: GitHub.