Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined offset: 0").
Previous exceptions
  • Undefined offset: 0 (8)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined offset: 0")." Stacktrace: #22 Twig\Error\RuntimeError in /var/www/html/public/content/themes/pbc/templates/single.twig:20 #21 Whoops\Exception\ErrorException in /var/www/html/public/content/themes/pbc/classes/Post.php:21 #20 Whoops\Run:handleError in /var/www/html/public/content/themes/pbc/classes/Post.php:21 #19 PBC\Post:get_category in /var/www/html/vendor/timber/timber/lib/Post.php:1047 #18 Timber\Post:category in /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php:1566 #17 twig_get_attribute in /var/www/html/vendor/twig/twig/src/Environment.php:418 #16 __TwigTemplate_9b0904570ad7cdeb04743ef9e05404ddf6867ad111c006f02f5a7cc44950b768:block_content in /var/www/html/vendor/twig/twig/src/Template.php:182 #15 Twig\Template:displayBlock in /var/www/html/vendor/twig/twig/src/Environment.php:418 #14 __TwigTemplate_0085b793dcbba8716dd82cdccafd5473461b6103fe554c20103784db5fb0c839:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #13 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #12 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #11 __TwigTemplate_9b0904570ad7cdeb04743ef9e05404ddf6867ad111c006f02f5a7cc44950b768:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #10 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #9 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Template.php:390 #8 Twig\Template:render in /var/www/html/vendor/twig/twig/src/TemplateWrapper.php:45 #7 Twig\TemplateWrapper:render in /var/www/html/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/html/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/html/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/html/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/html/public/content/themes/pbc/single.php:188 #2 include in /var/www/html/public/wordpress/wp-includes/template-loader.php:106 #1 require_once in /var/www/html/public/wordpress/wp-blog-header.php:19 #0 require in /var/www/html/public/index.php:10
22
Twig\Error\RuntimeError
/public/content/themes/pbc/templates/single.twig20
21
Whoops\Exception\ErrorException
/public/content/themes/pbc/classes/Post.php21
20
Whoops\Run handleError
/public/content/themes/pbc/classes/Post.php21
19
PBC\Post get_category
/vendor/timber/timber/lib/Post.php1047
18
Timber\Post category
/vendor/twig/twig/src/Extension/CoreExtension.php1566
17
twig_get_attribute
/vendor/twig/twig/src/Environment.php418
16
__TwigTemplate_9b0904570ad7cdeb04743ef9e05404ddf6867ad111c006f02f5a7cc44950b768 block_content
/vendor/twig/twig/src/Template.php182
15
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
14
__TwigTemplate_0085b793dcbba8716dd82cdccafd5473461b6103fe554c20103784db5fb0c839 doDisplay
/vendor/twig/twig/src/Template.php405
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
12
Twig\Template display
/vendor/twig/twig/src/Environment.php418
11
__TwigTemplate_9b0904570ad7cdeb04743ef9e05404ddf6867ad111c006f02f5a7cc44950b768 doDisplay
/vendor/twig/twig/src/Template.php405
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
9
Twig\Template display
/vendor/twig/twig/src/Template.php390
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php45
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/public/content/themes/pbc/single.php188
2
include
/public/wordpress/wp-includes/template-loader.php106
1
require_once
/public/wordpress/wp-blog-header.php19
0
require
/public/index.php10
/var/www/html/public/content/themes/pbc/templates/single.twig
{% extends 'base.twig' %}
 
{% block content %}
    {% if post.thumbnail and long %}
    <div class="longtext-header">
        <img class="longtext-header__img" src="{{ post.thumbnail.src }}" alt="{{ post.thumbnail.alt }}" />
        <p id="caption-attachment-{{ post.thumbnail.id }}" class="wp-caption-text">
            <strong>{{ post.thumbnail.caption }}</strong>
        </p>
    </div>
    {% endif %}
 
    {% include 'components/blog-header.twig' %}
 
    <section class="blog">
        <div class="container blog__container">
            {% if not long %}
            <div id="share-buttons" class="share-buttons"></div>
            {% endif %}
            {% if post.category == 'Cartoons'  %}
            <div class="row blog__row">
                <div class="col-sm-12 comics">
                    <div class="comics__desktop">
                        {% include '@atoms/image.twig' with { item: post.custom.download_file } %}
                    </div>
                    <div class="comics__mobile">
                        {% if post.custom.mobile_version %}
                            {% include '@atoms/image.twig' with { item: post.custom.mobile_version } %}
                        {% else %}
                            {% include '@atoms/image.twig' with { item: post.custom.download_file } %}
                        {% endif %}
                    </div>
                </div>
            </div>
            {% endif %}
            <div class="row blog__row{% if long or post.category == 'Cartoons' or post.category == 'Endgames' %} blog__row--longread{% endif %}">
                <div class="col-sm-{% if long or post.category == 'Cartoons' %}9{% elseif post.category == 'Endgames' %}12{% else %}7{% endif %}">
                    {% if long %}
                    <div id="share-buttons" class="share-buttons"></div>
                    {% endif %}
/var/www/html/public/content/themes/pbc/classes/Post.php
 
namespace PBC;
 
class Post extends \Timber\Post {
 
    private $authors = [];
    protected $issue_posts = null;
    protected static $pt = 'post';
 
    //Override \Timber\Post call to get first category to suppress Editor's Picks category
    public function get_category( ) {
        $cats = $this->get_categories();
 
        if ( is_array($cats) ) {
            foreach($cats as $cat) {
                if($cat->ID != 113508) {
                    return $cat;
                }
            }
            return $cats[0];
        }
    }
 
    public static function get_latest() {
        $latest =  new \Timber\PostQuery([
            'post_type' => static::$pt,
            'post_status' => 'any',
            'posts_per_page' => 5,
            'orderby' => 'DATE',
            'order' => 'DESC'
        ], get_called_class());
 
        return $latest;
    }
 
    public function get_overwrite_authors() {
        return get_field('authors', $this->id);
    }
 
    public function get_authors() {
Exception message: Undefined offset: 0
/var/www/html/public/content/themes/pbc/classes/Post.php
 
namespace PBC;
 
class Post extends \Timber\Post {
 
    private $authors = [];
    protected $issue_posts = null;
    protected static $pt = 'post';
 
    //Override \Timber\Post call to get first category to suppress Editor's Picks category
    public function get_category( ) {
        $cats = $this->get_categories();
 
        if ( is_array($cats) ) {
            foreach($cats as $cat) {
                if($cat->ID != 113508) {
                    return $cat;
                }
            }
            return $cats[0];
        }
    }
 
    public static function get_latest() {
        $latest =  new \Timber\PostQuery([
            'post_type' => static::$pt,
            'post_status' => 'any',
            'posts_per_page' => 5,
            'orderby' => 'DATE',
            'order' => 'DESC'
        ], get_called_class());
 
        return $latest;
    }
 
    public function get_overwrite_authors() {
        return get_field('authors', $this->id);
    }
 
    public function get_authors() {
/var/www/html/vendor/timber/timber/lib/Post.php
        return ($user_id ? new User($user_id) : $this->author());
    }
 
    /**
     * Get the categoires on a particular post
     * @api
     * @return array of Timber\Terms
     */
    public function categories() {
        return $this->terms('category');
    }
 
    /**
     * Returns a category attached to a post
     * @api
     * If mulitpuile categories are set, it will return just the first one
     * @return Timber\Term|null
     */
    public function category() {
        return $this->get_category();
    }
 
    /**
     * Returns an array of children on the post as Timber\Posts
     * (or other claass as you define).
     * @api
     * @example
     * ```twig
     * {% if post.children %}
     *     Here are the child pages:
     *     {% for child in post.children %}
     *         <a href="{{ child.link }}">{{ child.title }}</a>
     *     {% endfor %}
     * {% endif %}
     * ```
     * @param string|array $post_type _optional_ use to find children of a particular post type (attachment vs. page for example). You might want to restrict to certain types of children in case other stuff gets all mucked in there. You can use 'parent' to use the parent's post type or you can pass an array of post types.
     * @param string|bool $childPostClass _optional_ a custom post class (ex: 'MyTimber\Post') to return the objects as. By default (false) it will use Timber\Post::$post_class value.
     * @return array
     */
    public function children( $post_type = 'any', $childPostClass = false ) {
/var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php
 
        if ($ignoreStrictCheck || !$env->isStrictVariables()) {
            return;
        }
 
        throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
    }
 
    if ($isDefinedTest) {
        return true;
    }
 
    if ($sandboxed) {
        $env->getExtension(SandboxExtension::class)->checkMethodAllowed($object, $method, $lineno, $source);
    }
 
    // Some objects throw exceptions when they have __call, and the method we try
    // to call is not supported. If ignoreStrictCheck is true, we should return null.
    try {
        $ret = $object->$method(...$arguments);
    } catch (\BadMethodCallException $e) {
        if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
            return;
        }
        throw $e;
    }
 
    return $ret;
}
 
/**
 * Returns the values from a single column in the input array.
 *
 * <pre>
 *  {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
 *
 *  {% set fruits = items|column('fruit') %}
 *
 *  {# fruits now contains ['apple', 'orange'] #}
 * </pre>
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
    {
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Template.php
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
/var/www/html/vendor/twig/twig/src/TemplateWrapper.php
     * directly (use Twig\Environment::load() instead).
     *
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function render(array $context = []): string
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display(array $context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     */
/var/www/html/vendor/timber/timber/lib/Loader.php
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
/var/www/html/vendor/timber/timber/lib/Timber.php
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
/var/www/html/vendor/timber/timber/lib/Timber.php
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
/var/www/html/vendor/timber/timber/lib/Timber.php
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
/var/www/html/public/content/themes/pbc/single.php
            'post_type' => 'issues',
            'post_status' => 'publish',
            'posts_per_page' => 1,
            'post__in' => [$met]
        ]);
 
        if (!empty($issues)) {
            $context['issue'] = $issues[0];
        }
    }
}
 
$context['comments_open'] = comments_open();
$check = Caffeine\Feature\Meter\FrontEnd\Checker::check();
$context['enable_comments'] = !$check['blocker'];
 
if ( post_password_required( $post->ID ) ) {
    Timber::render( 'single-password.twig', $context );
} else {
    Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context );
}
 
/var/www/html/public/wordpress/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
/var/www/html/public/wordpress/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
/var/www/html/public/index.php
<?php
 
ini_set( 'display_errors', 1 );
ini_set( 'display_startup_errors', 1 );
error_reporting( E_ALL );
 
// WordPress view bootstrapper
define( 'WP_USE_THEMES', true );
 
require './wordpress/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
Key Value
signup-auth 280636275628bd7075f54c2.84226671
session_pbc_bcc ce5bd1fc86aea665ab37e85bd3d813d9
dummycookiename OWExZjBmMWU1NTcxZDkyOGJlZmEwN2JiNjMwYzNhYzI=
Key Value
SERVER_SOFTWARE nginx/1.20.2
REQUEST_URI /podcasts/the-prospect-interview-podcast-george-saunders-swim-in-pond-rain-russian-short-story
FILE_SYSTEM_ID fs-0837253d
WP_HOME *****************************
HOSTNAME ec1f2ced6706
PHP_INI_DIR /etc/php7
MOUNT_DIRECTORY /efs
SHLVL 1
HOME /root
DB_NAME ****************
WP_ENV *******
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WP_SITEURL **************************************
MAGICK_HOME /usr
GOOGLE_AD_MANAGER_ACTIVE true
SESSION_SAVE_HANDLER files
DB_PASSWORD ******************
PWD /var/www/html
GOOGLE_AD_MANAGER_ID 21688349148
DB_HOST *******************************************************************************
DB_USER ***************
HTTP_ACCEPT_ENCODING br,gzip
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-628bd707-483e10c2686861216476b517
HTTP_HOST stag.prospect.pbc.io
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 35.172.111.71
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 52988
REMOTE_ADDR 172.31.8.78
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT ********************
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME ******************************
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1653331719.3537
REQUEST_TIME 1653331719
Key Value
FILE_SYSTEM_ID fs-0837253d
WP_HOME *****************************
HOSTNAME ec1f2ced6706
PHP_INI_DIR /etc/php7
MOUNT_DIRECTORY /efs
SHLVL 1
HOME /root
DB_NAME ****************
WP_ENV *******
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WP_SITEURL **************************************
MAGICK_HOME /usr
GOOGLE_AD_MANAGER_ACTIVE true
SESSION_SAVE_HANDLER files
DB_PASSWORD ******************
PWD /var/www/html
GOOGLE_AD_MANAGER_ID 21688349148
DB_HOST *******************************************************************************
DB_USER ***************
HTTP_ACCEPT_ENCODING br,gzip
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-628bd707-483e10c2686861216476b517
HTTP_HOST stag.prospect.pbc.io
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 35.172.111.71
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 52988
REMOTE_ADDR 172.31.8.78
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /var/www/html/public
DOCUMENT_URI /index.php
REQUEST_URI /podcasts/the-prospect-interview-podcast-george-saunders-swim-in-pond-rain-russian-short-story
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /var/www/html/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1653331719.3537
REQUEST_TIME 1653331719
0. Whoops\Handler\PrettyPageHandler