octobercms/october · error · October\Rain\Exception\SystemException

Missing a blueprint source in the controller.

Error message

Missing a blueprint source in the controller.

What it means

Guard in PreviewController::getPreviewPageName: the behavior's activeSource (blueprint) was never set via setPreviewPageContext, so it cannot determine which component/page to look for. The hosting controller must define the blueprint source before preview lookups run.

Solutions

  1. Call setPreviewPageContext with the blueprint before previewing
  2. Ensure the controller bootstraps activeSource for preview requests
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/tailor/behaviors/PreviewController.php:127 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/1ed8db6110fdea30. Report an issue: GitHub.

Appendix: source

Thrown at modules/tailor/behaviors/PreviewController.php:127

    /**
     * hasPreviewPage
     */
    public function hasPreviewPage(): bool
    {
        return $this->getPreviewPageName() !== null;
    }

    /**
     * getPreviewPageName
     */
    protected function getPreviewPageName(): ?string
    {
        if ($this->previewPageName !== null) {
            return $this->previewPageName;
        }

        if (!$blueprint = $this->activeSource) {
            throw new SystemException('Missing a blueprint source in the controller.');
        }

        // Find page with component
        $theme = $this->getTheme();
        $cacheKey = self::getPreviewPageCacheKey($theme);
        $lookupKey = "{$this->componentName}.{$blueprint->handle}";
        $result = [];

        // Check cache
        $cached = Cache::memo()->get($cacheKey, false);
        if ($cached !== false && ($cached = @unserialize($cached, ['allowed_classes' => false])) !== false && is_array($cached)) {
            if (array_key_exists($lookupKey, $cached)) {
                return $cached[$lookupKey];
            }
            else {
                $result = $cached;
            }
        }

View on GitHub (pinned to b608633a7e)