octobercms/october · error · ApplicationException

Snippet with the requested code :code was not found in the t

Error message

Snippet with the requested code :code was not found in the theme.

What it means

Error "Snippet with the requested code :code was not found in the theme." thrown in octobercms/october.

Source

Thrown at modules/cms/widgets/SnippetLookup.php:113

     */
    public function onSearch()
    {
        $this->setSearchTerm(Input::get('search'));

        return $this->updateList();
    }

    /**
     * onGetInspectorConfiguration
     */
    public function onGetInspectorConfiguration()
    {
        $configuration = [];
        $snippetCode = post('snippet');
        $componentClass = post('component');

        if ($componentClass && !class_exists($componentClass)) {
            throw new ApplicationException(__("Snippet with the requested code :code was not found in the theme.", ['code' => $componentClass]));
        }

        if (strlen($snippetCode)) {
            $snippet = SnippetManager::instance()->findByCodeOrComponent($this->getTheme(), $snippetCode, $componentClass);
            if (!$snippet) {
                throw new ApplicationException(__("Snippet with the requested code :code was not found in the theme.", ['code' => $snippetCode]));
            }

            $configuration = $snippet->getProperties();
        }

        return [
            'configuration' => [
                'properties' => $configuration,
                'title' => $snippet->getName(),
                'description' => $snippet->getDescription()
            ]
        ];

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/cms/widgets/SnippetLookup.php:113 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/84367d113ebb6fd1. Report an issue: GitHub.