Twig\Error\RuntimeError {#645 -lineno: 6 -name: "@components/3-organisms/search-block/search-block.twig" -rawMessage: "Variable "headline" does not exist." -sourcePath: "/Users/dennis/Projekte/e-fellows/src/components/3-organisms/search-block/search-block.twig" -sourceCode: """ {% do craft.app.view.registerJsFile('https://scripts.chatbar-ai.com/cb-ai-search.min.js', {\n position: 1\n }) %}\n \n <div class="search-block">\n {% if headline %}\n <div class="search-block__headline headline headline--2">\n <h2>{{ headline }}</h2>\n </div>\n {% endif %}\n <div class="search-block__inner">\n <div class="search-container">\n <div id="ai-search-results">\n </div>\n <div class="item center" id="chatBot">\n <div id="auto_ai_search_bot">\n <p class="filler">\n {{ 'AI-search is loading...' | t }}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n {% js at head %}\n var searchResultsEle;\n var searchContainer;\n function addPageBox(sr) {\n var descHTML = "";\n var limit = window.innerWidth > 768 ? 100 : 50;\n if (sr.description) {\n let description = sr.description;\n if (description.length > limit) {\n description = description.substring(0, limit) + ' ...';\n }\n descHTML = '<p class="desc">' + description.replace('target="_blank"', '') + '</p>';\n }\n var div = document.createElement('div');\n div.classList.add('result-wrapper');\n var title = sr.title && sr.title.trim() !== '' ? sr.title : '';\n if (title) {\n title = title.replace(' - e-fellows.netAutor*innen', '').replace(' - e-fellows.net', '');\n }\n div.innerHTML = '<a class="link-box" href="'+ sr.source +'"><p class="title">' + title + '</p>' + descHTML + '</a>';\n searchResultsEle.appendChild(div);\n }\n searchResultsCallback = function(search_results) {\n searchResultsEle.innerHTML = '';\n search_results.forEach(function(sr) {\n addPageBox(sr);\n });\n };\n document.addEventListener('DOMContentLoaded', async function() {\n searchContainer = document.getElementById('auto_ai_search_bot');\n searchResultsEle = document.getElementById('ai-search-results');\n _bl_ai_search.init('{{ getenv("BUSINESS_LANDING_TOKEN") }}', searchContainer, {\n searchResultsCallback: searchResultsCallback,\n });\n });\n {% endjs %} """ }
{% do craft.app.view.registerJsFile('https://scripts.chatbar-ai.com/cb-ai-search.min.js', {position: 1}) %}<div class="search-block">{% if headline %}<div class="search-block__headline headline headline--2"><h2>{{ headline }}</h2></div>{% endif %}<div class="search-block__inner"> // line 4 yield "<div class=\"search-block\"> "; // line 6 if ((isset($context["headline"]) || array_key_exists("headline", $context) ? $context["headline"] : (craft\helpers\Template::fallbackExists("headline") ? craft\helpers\Template::fallback("headline") : (function () { throw new RuntimeError('Variable "headline" does not exist.', 6, $this->source); })()))) { // line 7 yield " <div class=\"search-block__headline headline headline--2\"> <h2>"; // line 8 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["headline"]) || array_key_exists("headline", $context) ? $context["headline"] : (craft\helpers\Template::fallbackExists("headline") ? craft\helpers\Template::fallback("headline") : (function () { throw new RuntimeError('Variable "headline" does not exist.', 8, $this->source); })())), "html", null, true); { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } ) { } public function render(array $context = []): string { return $this->template->render($context); } public function display(array $context = []) { // using func_get_args() allows to not expose the blocks argument * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ public function render($name, array $context = []): string { return $this->load($name)->render($context); } /** * Displays a template. * // Render and return $renderingTemplate = $this->_renderingTemplate; $this->_renderingTemplate = $template; try { $output = $this->getTwig()->render($template, $variables); } finally { $this->_renderingTemplate = $renderingTemplate; $this->setTemplateMode($oldTemplateMode); } $isRenderingPageTemplate = $this->_isRenderingPageTemplate; $this->_isRenderingPageTemplate = true; try { $this->beginPage(); echo $this->renderTemplate($template, $variables); $this->endPage(); } finally { $this->_isRenderingPageTemplate = $isRenderingPageTemplate; $this->setTemplateMode($oldTemplateMode); $output = ob_get_clean(); $event->roots['@components'] = Craft::getAlias('@root/src/components'); }, ); // Return rendered component Console::stdout(Craft::$app->getView()->renderPageTemplate( "@components/{$template}", $context, View::TEMPLATE_MODE_SITE, )); } catch (\Throwable $exception) { Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); }} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { if ($this->help) { $route = $this->getUniqueId() . '/' . $id; return Yii::$app->runAction('help', [$route]); } return parent::runAction($id, $params); } /** * Binds the parameters to the action. * This method is invoked by [[Action]] when it begins to run with the given parameters. public function runAction($id, $params = []) { try { // *should* only be an int, but there are exceptions :/ /** @var int|null $response */ $response = parent::runAction($id, $params); return $response ?? ExitCode::OK; } finally { if (isset($this->isolationMutexName)) { Craft::$app->getMutex()->release($this->isolationMutexName); } * @inheritdoc */ public function runAction($id, $params = []): int { $this->_actionId = $id; $result = $this->traitRunAction($id, $params); $this->_actionId = null; return $result; } /** if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; * @throws Exception if the route is invalid */ public function runAction($route, $params = []) { try { $res = parent::runAction($route, $params); return is_object($res) ? $res : (int) $res; } catch (InvalidRouteException $e) { throw new UnknownCommandException($route, $this, 0, $e); } } } Console::outputWarning("Craft can’t fetch the `$infoTable` table row." . ($e ? PHP_EOL . 'Exception: ' . $e->getMessage() : ''), false); } } return parent::runAction($route, $params); } /** * @inheritdoc */ */ public function handleRequest($request) { list($route, $params) = $request->resolve(); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); public function handleRequest($request) { // Disable read/write splitting for all console requests $this->getDb()->enableReplicas = false; return parent::handleRequest($request); } /** * Returns the configuration of the built-in commands. * try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE;// Load and run Craft/** @var craft\console\Application $app */// nosemgrep: file-inclusion$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';$exitCode = $app->run();exit($exitCode);|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Variable "headline" does not exist.
at /Users/dennis/Projekte/e-fellows/src/components/3-organisms/search-block/search-block.twig:6
at __TwigTemplate_4978ddf1bbcdfb89410907d15e3b68a1->{closure:__TwigTemplate_4978ddf1bbcdfb89410907d15e3b68a1::doDisplay():50}()
(/Users/dennis/Projekte/e-fellows/storage/runtime/compiled_templates/f4/f44f1da644e725d530718350b465947a.php:50)
at __TwigTemplate_4978ddf1bbcdfb89410907d15e3b68a1->doDisplay(array('title' => 'KI-gestützte Suche', 'craft' => object(CraftVariable), 'currentSite' => object(Site), 'currentUser' => null, 'primarySite' => object(Site), 'siteName' => 'Für Studierende und Berufstätige', 'siteUrl' => '@web/', 'systemName' => 'e-fellows.net', 'view' => object(View), 'devMode' => true, 'SORT_ASC' => 4, 'SORT_DESC' => 3, 'SORT_REGULAR' => 0, 'SORT_NUMERIC' => 1, 'SORT_STRING' => 2, 'SORT_LOCALE_STRING' => 5, 'SORT_NATURAL' => 6, 'SORT_FLAG_CASE' => 8, 'PHP_INT_MAX' => 9223372036854775807, 'POS_HEAD' => 1, 'POS_BEGIN' => 2, 'POS_END' => 3, 'POS_READY' => 4, 'POS_LOAD' => 5, 'isInstalled' => true, 'loginUrl' => '@web/', 'logoutUrl' => '@web/', 'setPasswordUrl' => null, 'now' => object(DateTime), 'today' => object(DateTime), 'tomorrow' => object(DateTime), 'yesterday' => object(DateTime), '_globals' => object(Collection), 'currentSsoUser' => null, 'login' => object(Entry), 'loginOtc' => object(Entry), 'forgotPassword' => object(Entry)), array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:387)
at Twig\Template->yield(array('title' => 'KI-gestützte Suche', 'craft' => object(CraftVariable), 'currentSite' => object(Site), 'currentUser' => null, 'primarySite' => object(Site), 'siteName' => 'Für Studierende und Berufstätige', 'siteUrl' => '@web/', 'systemName' => 'e-fellows.net', 'view' => object(View), 'devMode' => true, 'SORT_ASC' => 4, 'SORT_DESC' => 3, 'SORT_REGULAR' => 0, 'SORT_NUMERIC' => 1, 'SORT_STRING' => 2, 'SORT_LOCALE_STRING' => 5, 'SORT_NATURAL' => 6, 'SORT_FLAG_CASE' => 8, 'PHP_INT_MAX' => 9223372036854775807, 'POS_HEAD' => 1, 'POS_BEGIN' => 2, 'POS_END' => 3, 'POS_READY' => 4, 'POS_LOAD' => 5, 'isInstalled' => true, 'loginUrl' => '@web/', 'logoutUrl' => '@web/', 'setPasswordUrl' => null, 'now' => object(DateTime), 'today' => object(DateTime), 'tomorrow' => object(DateTime), 'yesterday' => object(DateTime), '_globals' => object(Collection), 'currentSsoUser' => null, 'login' => object(Entry), 'loginOtc' => object(Entry), 'forgotPassword' => object(Entry)), array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:343)
at Twig\Template->display(array('title' => 'KI-gestützte Suche'))
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:358)
at Twig\Template->render(array('title' => 'KI-gestützte Suche'))
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/TemplateWrapper.php:35)
at Twig\TemplateWrapper->render(array('title' => 'KI-gestützte Suche'))
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Environment.php:320)
at Twig\Environment->render('@components/3-organisms/search-block/search-block.twig', array('title' => 'KI-gestützte Suche'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/web/View.php:570)
at craft\web\View->renderTemplate('@components/3-organisms/search-block/search-block.twig', array('title' => 'KI-gestützte Suche'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/web/View.php:623)
at craft\web\View->renderPageTemplate('@components/3-organisms/search-block/search-block.twig', array('title' => 'KI-gestützte Suche'), 'site')
(/Users/dennis/Projekte/e-fellows/src/module/Console/Controller/ComponentController.php:56)
at EFellows\Website\Console\Controller\ComponentController->actionRender('3-organisms/search-block/search-block.twig')
at call_user_func_array(array(object(ComponentController), 'actionRender'), array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/InlineAction.php:57)
at yii\base\InlineAction->runWithParams(array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Controller.php:178)
at yii\base\Controller->runAction('render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Controller.php:180)
at yii\console\Controller->runAction('render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/ControllerTrait.php:88)
at craft\console\Controller->traitRunAction('render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Controller.php:216)
at craft\console\Controller->runAction('render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Module.php:552)
at yii\base\Module->runAction('efellows/component/render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Application.php:180)
at yii\console\Application->runAction('efellows/component/render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Application.php:91)
at craft\console\Application->runAction('efellows/component/render', array('3-organisms/search-block/search-block.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Application.php:147)
at yii\console\Application->handleRequest(object(Request))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Application.php:122)
at craft\console\Application->handleRequest(object(Request))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Application.php:384)
at yii\base\Application->run()
(/Users/dennis/Projekte/e-fellows/craft:17)
|