Twig\Error\RuntimeError

Variable "category" does not exist.

Stack trace

1 {% extends '_layouts/pages' %}
2 {% set bodyId = 'Genre' %}
3
4 {% block content %}
5 {% set query = craft.entries.section('bookReviews').relatedTo(category).limit(7) %}
6
7
8 <h3>Genre: <span class="small bb-small">{{ category.title }}</span></h3>
9
10 {% paginate query as pageInfo, pageEntries %}
11 {% for entry in pageEntries %}
12
13 <!-- Set Related -->
1 {% extends '_layouts/pages' %}
2 {% set bodyId = 'Genre' %}
3
4 {% block content %}
5 {% set query = craft.entries.section('bookReviews').relatedTo(category).limit(7) %}
6
7
8 <h3>Genre: <span class="small bb-small">{{ category.title }}</span></h3>
9
10 {% paginate query as pageInfo, pageEntries %}
164 // avoid RCEs when sandbox is enabled
165 if (null !== $template && !$template instanceof self) {
166 throw new \LogicException('A block must be a method on a \Twig\Template instance.');
167 }
168
169 if (null !== $template) {
170 try {
171 $template->$block($context, $blocks);
172 } catch (Error $e) {
173 if (!$e->getSourceContext()) {
174 $e->setSourceContext($template->getSourceContext());
175 }
176
35 </header>
36
37 <!-- Start Content Divs -->
38 <main role="main scrollUp" class="container">
39 <div class="row">
40 <div class="col-lg-9 bb-col1-pad bb-col1">
41 <!-- Begin Entry Content -->
42 {% block content %}
43 {% endblock %}
44
45 </div>
46
47
387
388 return ob_get_clean();
389 }
390
391 protected function displayWithErrorHandling(array $context, array $blocks = [])
392 {
393 try {
394 $this->doDisplay($context, $blocks);
395 } catch (Error $e) {
396 if (!$e->getSourceContext()) {
397 $e->setSourceContext($this->getSourceContext());
398 }
399
360 public function getBlocks()
361 {
362 return $this->blocks;
363 }
364
365 public function display(array $context, array $blocks = [])
366 {
367 $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
368 }
369
370 public function render(array $context)
371 {
372 $level = ob_get_level();
1 {% extends '_layouts/pages' %}
2 {% set bodyId = 'Genre' %}
3
4 {% block content %}
5 {% set query = craft.entries.section('bookReviews').relatedTo(category).limit(7) %}
6
387
388 return ob_get_clean();
389 }
390
391 protected function displayWithErrorHandling(array $context, array $blocks = [])
392 {
393 try {
394 $this->doDisplay($context, $blocks);
395 } catch (Error $e) {
396 if (!$e->getSourceContext()) {
397 $e->setSourceContext($this->getSourceContext());
398 }
399
360 public function getBlocks()
361 {
362 return $this->blocks;
363 }
364
365 public function display(array $context, array $blocks = [])
366 {
367 $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
368 }
369
370 public function render(array $context)
371 {
372 $level = ob_get_level();
372 $level = ob_get_level();
373 if ($this->env->isDebug()) {
374 ob_start();
375 } else {
376 ob_start(function () { return ''; });
377 }
378 try {
379 $this->display($context);
380 } catch (\Throwable $e) {
381 while (ob_get_level() > $level) {
382 ob_end_clean();
383 }
384
31 {
32 $this->env = $env;
33 $this->template = $template;
34 }
35
36 public function render(array $context = []): string
37 {
38 return $this->template->render($context);
39 }
40
41 public function display(array $context = [])
42 {
43 // using func_get_args() allows to not expose the blocks argument
273 *
274 * @throws LoaderError When the template cannot be found
275 * @throws SyntaxError When an error occurred during compilation
276 * @throws RuntimeError When an error occurred during rendering
277 */
278 public function render($name, array $context = []): string
279 {
280 return $this->load($name)->render($context);
281 }
282
283 /**
284 * Displays a template.
285 *
475 $this->setTemplateMode($templateMode);
476
477 // Render and return
478 $renderingTemplate = $this->_renderingTemplate;
479 $this->_renderingTemplate = $template;
480
481 try {
482 $output = $this->getTwig()->render($template, $variables);
483 } finally {
484 $this->_renderingTemplate = $renderingTemplate;
485 $this->setTemplateMode($oldTemplateMode);
486 }
487
528 $this->setTemplateMode($templateMode);
529
530 $isRenderingPageTemplate = $this->_isRenderingPageTemplate;
531 $this->_isRenderingPageTemplate = true;
532
533 try {
534 $this->beginPage();
535 echo $this->renderTemplate($template, $variables);
536 $this->endPage();
537 } finally {
538 $this->_isRenderingPageTemplate = $isRenderingPageTemplate;
539 $this->setTemplateMode($oldTemplateMode);
540 $output = ob_get_clean();
50 $generalConfig->useIframeResizer
51 ) {
52 $view->registerAssetBundle(ContentWindowAsset::class);
53 }
54
55 // Render and return the template
56 try {
57 $response->content = $view->renderPageTemplate($behavior->template, $behavior->variables, $behavior->templateMode);
58 } catch (Throwable $e) {
59 $previous = $e->getPrevious();
60 if ($previous instanceof YiiExitException) {
61 // Something called Craft::$app->end()
62 if ($previous instanceof ExitException && $previous->output !== null) {
1093
1094 if (isset($this->formatters[$this->format])) {
1095 $formatter = $this->formatters[$this->format];
1096 if (!is_object($formatter)) {
1097 $this->formatters[$this->format] = $formatter = Yii::createObject($formatter);
1098 }
1099 if ($formatter instanceof ResponseFormatterInterface) {
1100 $formatter->format($this);
1101 } else {
1102 throw new InvalidConfigException("The '{$this->format}' response formatter is invalid. It must implement the ResponseFormatterInterface.");
1103 }
1104 } elseif ($this->format === self::FORMAT_RAW) {
1105 if ($this->data !== null) {
330 }
331
332 /**
333 * @inheritdoc
334 */
335 protected function prepare(): void
336 {
337 parent::prepare();
338 $this->_isPrepared = true;
339 }
340
341 /**
342 * Clear the output buffer to prevent corrupt downloads.
333 */
334 public function send()
335 {
336 if ($this->isSent) {
337 return;
338 }
339 $this->trigger(self::EVENT_BEFORE_SEND);
340 $this->prepare();
341 $this->trigger(self::EVENT_AFTER_PREPARE);
342 $this->sendHeaders();
343 $this->sendContent();
344 $this->trigger(self::EVENT_AFTER_SEND);
345 $this->isSent = true;
383 $this->state = self::STATE_HANDLING_REQUEST;
384 $response = $this->handleRequest($this->getRequest());
385
386 $this->state = self::STATE_AFTER_REQUEST;
387 $this->trigger(self::EVENT_AFTER_REQUEST);
388
389 $this->state = self::STATE_SENDING_RESPONSE;
390 $response->send();
391
392 $this->state = self::STATE_END;
393
394 return $response->exitStatus;
395 } catch (ExitException $e) {
5
6 // Load shared bootstrap
7 require dirname(__DIR__) . '/cms1/bootstrap.php';
8
9 // Load and run Craft
10 /** @var craft\web\Application $app */
11 $app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
12 $app->run();

Query Params / GET

p "genre\/all"

Route

Controller / Action templates/render

Session

ID

Cookies

User

ID Guest

Application Info

PHP version 8.1.27
OS version Linux 5.15.0-100-generic
Craft edition & version Craft Solo 4.8.2
Yii version 2.0.48.1

Modules

my-module modules\Module
verbb-base verbb\base\Base
verbb-auth verbb\auth\Auth

Plugins

architect pennebaker\architect\Architect
canary TopShelfCraft\Canary\Canary
craftagram scaramangagency\craftagram\Craftagram
embeddedassets spicyweb\embeddedassets\Plugin
feed-me craft\feedme\Plugin
minify nystudio107\minify\Minify
redactor craft\redactor\Plugin
redactor-tweaks verbb\redactortweaks\RedactorTweaks
seo ether\seo\Seo
similar nystudio107\similar\Similar
social-share verbb\socialshare\SocialShare
ss-twitter-feed ssplugin\sstwitterfeed\SsTwitterFeed

Aliases

@TopShelfCraft/Canary /mnt/www/cms1/vendor/topshelfcraft/canary/src
@app /mnt/www/cms1/vendor/craftcms/cms/src
@appicons /mnt/www/cms1/vendor/craftcms/cms/src/icons
@assetBasePath /mnt/www/media/bookish
@assetBaseUrl https://media.bookishbiker.com/bookish
@bower /mnt/www/cms1/vendor/bower
@bower/inputmask/dist /mnt/www/cms1/vendor/craftcms/cms/src/web/assets/inputmask/dist
@bower/jquery/dist /mnt/www/cms1/vendor/craftcms/cms/src/web/assets/jquery/dist
@bower/punycode /mnt/www/cms1/vendor/craftcms/cms/src/web/assets/punycode/dist
@bower/yii2-pjax /mnt/www/cms1/vendor/craftcms/cms/src/web/assets/yii2pjax/dist
@config /mnt/www/cms1/config
@contentMigrations /mnt/www/cms1/migrations
@craft /mnt/www/cms1/vendor/craftcms/cms/src
@craft/feedme /mnt/www/cms1/vendor/craftcms/feed-me/src
@craft/redactor /mnt/www/cms1/vendor/craftcms/redactor/src
@craftcms /mnt/www/cms1/vendor/craftcms/cms
@creocoder/nestedsets /mnt/www/cms1/vendor/creocoder/yii2-nested-sets/src
@dotenv /mnt/www/cms1/.env
@ether/seo /mnt/www/cms1/vendor/ether/seo/src
@lib /mnt/www/cms1/vendor/craftcms/cms/lib
@npm /mnt/www/cms1/vendor/npm
@nystudio107/minify /mnt/www/cms1/vendor/nystudio107/craft-minify/src
@nystudio107/similar /mnt/www/cms1/vendor/nystudio107/craft-similar/src
@pennebaker/architect /mnt/www/cms1/vendor/pennebaker/craft-architect/src
@root /mnt/www/cms1
@runtime /mnt/www/cms1/storage/runtime
@samdark/log /mnt/www/cms1/vendor/samdark/yii2-psr-log-target/src
@samdark/log/tests /mnt/www/cms1/vendor/samdark/yii2-psr-log-target/tests
@scaramangagency/craftagram /mnt/www/cms1/vendor/scaramangagency/craftagram/src
@spicyweb/embeddedassets /mnt/www/cms1/vendor/spicyweb/craft-embedded-assets/src
@ssplugin/sstwitterfeed /mnt/www/cms1/vendor/ssplugin/ss-twitter-feed/src
@storage /mnt/www/cms1/storage
@templates /mnt/www/media/bookish/templates
@tests /mnt/www/cms1/tests
@translations /mnt/www/cms1/translations
@vendor /mnt/www/cms1/vendor
@verbb/auth /mnt/www/cms1/vendor/verbb/auth/src
@verbb/base /mnt/www/cms1/vendor/verbb/base/src
@verbb/redactortweaks /mnt/www/cms1/vendor/verbb/redactor-tweaks/src
@verbb/socialshare /mnt/www/cms1/vendor/verbb/social-share/src
@web https://bookishbiker.com
@webroot /mnt/www/cms1/mnt/www/reviews
@yii /mnt/www/cms1/vendor/yiisoft/yii2
@yii/debug /mnt/www/cms1/vendor/yiisoft/yii2-debug/src
@yii/queue /mnt/www/cms1/vendor/yiisoft/yii2-queue/src
@yii/queue/amqp /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/amqp
@yii/queue/amqp_interop /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/amqp_interop
@yii/queue/beanstalk /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/beanstalk
@yii/queue/db /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/db
@yii/queue/file /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/file
@yii/queue/gearman /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/gearman
@yii/queue/redis /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/redis
@yii/queue/sqs /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/sqs
@yii/queue/stomp /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/stomp
@yii/queue/sync /mnt/www/cms1/vendor/yiisoft/yii2-queue/src/drivers/sync
@yii/shell /mnt/www/cms1/vendor/yiisoft/yii2-shell
@yii/symfonymailer /mnt/www/cms1/vendor/yiisoft/yii2-symfonymailer/src

CP Template Roots

architect /mnt/www/cms1/vendor/pennebaker/craft-architect/src/templates
craftagram /mnt/www/cms1/vendor/scaramangagency/craftagram/src/templates
embeddedassets /mnt/www/cms1/vendor/spicyweb/craft-embedded-assets/src/templates
feed-me /mnt/www/cms1/vendor/craftcms/feed-me/src/templates
redactor /mnt/www/cms1/vendor/craftcms/redactor/src/templates
seo /mnt/www/cms1/vendor/ether/seo/src/templates
social-share /mnt/www/cms1/vendor/verbb/social-share/src/templates
ss-twitter-feed /mnt/www/cms1/vendor/ssplugin/ss-twitter-feed/src/templates
verbb-base /mnt/www/cms1/vendor/verbb/base/src/templates

Site Template Roots

architect /mnt/www/cms1/vendor/pennebaker/craft-architect/src/templates
craftagram /mnt/www/cms1/vendor/scaramangagency/craftagram/src/templates
embeddedassets /mnt/www/cms1/vendor/spicyweb/craft-embedded-assets/src/templates
feed-me /mnt/www/cms1/vendor/craftcms/feed-me/src/templates
redactor /mnt/www/cms1/vendor/craftcms/redactor/src/templates
seo /mnt/www/cms1/vendor/ether/seo/src/templates
social-share /mnt/www/cms1/vendor/verbb/social-share/src/templates
ss-twitter-feed /mnt/www/cms1/vendor/ssplugin/ss-twitter-feed/src/templates
verbb-base /mnt/www/cms1/vendor/verbb/base/src/templates

Server/Environment Values

REDIRECT_HTTPS on
REDIRECT_SSL_TLS_SNI bookishbiker.com
REDIRECT_STATUS 200
HTTPS on
SSL_TLS_SNI bookishbiker.com
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST bookishbiker.com
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SERVER_SIGNATURE <address>Apache/2.4.52 (Ubuntu) Server at bookishbiker.com Port 443</address>
SERVER_SOFTWARE Apache/2.4.52 (Ubuntu)
SERVER_NAME bookishbiker.com
SERVER_ADDR 164.92.104.23
SERVER_PORT 443
REMOTE_ADDR 54.224.52.210
DOCUMENT_ROOT /mnt/www/reviews
REQUEST_SCHEME https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /mnt/www/reviews
SERVER_ADMIN www@bookishbiker.com
SCRIPT_FILENAME /mnt/www/reviews/index.php
REMOTE_PORT 33528
REDIRECT_URL /genre/all
REDIRECT_QUERY_STRING p=genre/all
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING p=genre/all
REQUEST_URI /genre/all
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710842785.3955
REQUEST_TIME 1710842785
CRAFT_APP_ID CraftCMS--11740404-09de-4180-b243-6f03ac027da3
CRAFT_ENVIRONMENT dev
CRAFT_SECURITY_KEY ••••••••••••••••••••••••••••••••
CRAFT_DB_DRIVER mysql
CRAFT_DB_SERVER localhost
CRAFT_DB_PORT 3306
CRAFT_DB_DATABASE b_01
CRAFT_DB_USER kiwigrrl
CRAFT_DB_PASSWORD ••••••••••••
CRAFT_DB_SCHEMA
CRAFT_DB_TABLE_PREFIX craft_
CRAFT_TEMPLATES_PATH /mnt/www/media/bookish/templates
PRIMARY_SITE_URL https://bookishbiker.com/
ASSETS_BASE_URL https://media.bookishbiker.com/bookish
ASSETS_BASE_PATH /mnt/www/media/bookish