octobercms/october · error · ValidationException

Please enter a valid URL

Error message

Please enter a valid URL

What it means

Error "Please enter a valid URL" thrown in octobercms/october.

Source

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

        $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;

        // Split params and data
        $params = $data;
        if ($title = $model->getReferenceLabel()) {
            $params['title'] = $title;

            if ($this->shouldIncludeTitle()) {
                $data['title'] = $title;
            }
        }

        return [

View on GitHub (pinned to b608633a7e)

When it happens

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