Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined property: WP_Error::$term_id").
Previous exceptions
  • Undefined property: WP_Error::$term_id (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined property: WP_Error::$term_id")." Stacktrace: #55 Twig\Error\RuntimeError in /www/sciencewiz_190/public/wp-content/themes/g5_sciencewiz/particles/portal.html.twig:6 #54 Whoops\Exception\ErrorException in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/TermGetter.php:16 #53 Gantry\Component\Whoops\SystemFacade:handleError in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/TermGetter.php:16 #52 Timber\TermGetter:get_term in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:200 #51 Timber\Timber:get_term in /www/sciencewiz_190/public/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Base/Platform.php:287 #50 call_user_func_array in /www/sciencewiz_190/public/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Base/Platform.php:287 #49 Gantry\Framework\Base\Platform:call in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:702 #48 Twig\Template:getAttribute in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #47 __TwigTemplate_b4ee8843dc69bd94f1176a10729ad760e97ff19436355b3504635dbadbe1fc3e:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #46 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #45 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #44 __TwigTemplate_535a9468c97fea7c31efca4d373aa49ed6c5a099b3380762eec542e38d757ea8:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #43 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #42 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #41 __TwigTemplate_62d5ccda532f5b037dc7e15884b52878f629c6216a02894acec3b1808c356957:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #40 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #39 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #38 __TwigTemplate_92bf36437653ae145260fc580edc00a7e3ce774a557c8f03e3b535f5200685ed:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #37 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #36 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #35 __TwigTemplate_347b898669b817a43bfbe0d5a8e151f67d7088f10f516dcec571b2bc44fa7355:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #34 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #33 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #32 __TwigTemplate_62d5ccda532f5b037dc7e15884b52878f629c6216a02894acec3b1808c356957:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #31 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #30 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #29 __TwigTemplate_92bf36437653ae145260fc580edc00a7e3ce774a557c8f03e3b535f5200685ed:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #28 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #27 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #26 __TwigTemplate_402b72bdea346233eed41f80e65a75c2e5dc1cc9a3052a3e2683a609590aae7f:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #25 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #24 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #23 __TwigTemplate_bdf8d28c52fee31b60cbfdf89c729b6772c6b9d8f296b0f8f17d983c4fa61151:block_page_layout in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #22 Twig\Template:displayBlock in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #21 __TwigTemplate_bdf8d28c52fee31b60cbfdf89c729b6772c6b9d8f296b0f8f17d983c4fa61151:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #20 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #19 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #18 __TwigTemplate_f18387f3bf89af71d9607407a019958e74dbc852c898415a09e0e9d4ac9f4245:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #17 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #16 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #15 __TwigTemplate_6e8c558f2ce1206d13f6aad991bf28b9075eac82880a1f2a35c84cbf4d3afc7f:doDisplay in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #14 Twig\Template:displayWithErrorHandling in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #13 Twig\Template:display in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:432 #12 Twig\Template:render in /www/sciencewiz_190/public/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #11 Twig\TemplateWrapper:render in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:79 #10 Timber\Loader:render in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #9 Timber\Timber:compile in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #8 Timber\Timber:fetch in /www/sciencewiz_190/public/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #7 Timber\Timber:render in /www/sciencewiz_190/public/wp-content/themes/g5_sciencewiz/footer.php:30 #6 require_once in /www/sciencewiz_190/public/wp-includes/template.php:810 #5 load_template in /www/sciencewiz_190/public/wp-includes/template.php:745 #4 locate_template in /www/sciencewiz_190/public/wp-includes/general-template.php:92 #3 get_footer in /www/sciencewiz_190/public/wp-content/plugins/woocommerce/templates/single-product.php:60 #2 include in /www/sciencewiz_190/public/wp-includes/template-loader.php:106 #1 require_once in /www/sciencewiz_190/public/wp-blog-header.php:19 #0 require in /www/sciencewiz_190/public/index.php:17
Stack frames (56)
55
Twig\Error\RuntimeError
/www/sciencewiz_190/public/wp-content/themes/g5_sciencewiz/particles/portal.html.twig6
54
Whoops\Exception\ErrorException
/vendor/timber/timber/lib/TermGetter.php16
53
Gantry\Component\Whoops\SystemFacade handleError
/vendor/timber/timber/lib/TermGetter.php16
52
Timber\TermGetter get_term
/vendor/timber/timber/lib/Timber.php200
51
Timber\Timber get_term
/src/classes/Gantry/Framework/Base/Platform.php287
50
call_user_func_array
/src/classes/Gantry/Framework/Base/Platform.php287
49
Gantry\Framework\Base\Platform call
/compat/vendor/twig/twig/src/Template.php702
48
Twig\Template getAttribute
/compat/vendor/twig/twig/src/Environment.php497
47
__TwigTemplate_b4ee8843dc69bd94f1176a10729ad760e97ff19436355b3504635dbadbe1fc3e doDisplay
/compat/vendor/twig/twig/src/Template.php453
46
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
45
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
44
__TwigTemplate_535a9468c97fea7c31efca4d373aa49ed6c5a099b3380762eec542e38d757ea8 doDisplay
/compat/vendor/twig/twig/src/Template.php453
43
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
42
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
41
__TwigTemplate_62d5ccda532f5b037dc7e15884b52878f629c6216a02894acec3b1808c356957 doDisplay
/compat/vendor/twig/twig/src/Template.php453
40
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
39
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
38
__TwigTemplate_92bf36437653ae145260fc580edc00a7e3ce774a557c8f03e3b535f5200685ed doDisplay
/compat/vendor/twig/twig/src/Template.php453
37
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
36
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
35
__TwigTemplate_347b898669b817a43bfbe0d5a8e151f67d7088f10f516dcec571b2bc44fa7355 doDisplay
/compat/vendor/twig/twig/src/Template.php453
34
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
33
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
32
__TwigTemplate_62d5ccda532f5b037dc7e15884b52878f629c6216a02894acec3b1808c356957 doDisplay
/compat/vendor/twig/twig/src/Template.php453
31
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
30
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
29
__TwigTemplate_92bf36437653ae145260fc580edc00a7e3ce774a557c8f03e3b535f5200685ed doDisplay
/compat/vendor/twig/twig/src/Template.php453
28
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
27
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
26
__TwigTemplate_402b72bdea346233eed41f80e65a75c2e5dc1cc9a3052a3e2683a609590aae7f doDisplay
/compat/vendor/twig/twig/src/Template.php453
25
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
24
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
23
__TwigTemplate_bdf8d28c52fee31b60cbfdf89c729b6772c6b9d8f296b0f8f17d983c4fa61151 block_page_layout
/compat/vendor/twig/twig/src/Template.php214
22
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Environment.php497
21
__TwigTemplate_bdf8d28c52fee31b60cbfdf89c729b6772c6b9d8f296b0f8f17d983c4fa61151 doDisplay
/compat/vendor/twig/twig/src/Template.php453
20
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
19
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
18
__TwigTemplate_f18387f3bf89af71d9607407a019958e74dbc852c898415a09e0e9d4ac9f4245 doDisplay
/compat/vendor/twig/twig/src/Template.php453
17
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
16
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
15
__TwigTemplate_6e8c558f2ce1206d13f6aad991bf28b9075eac82880a1f2a35c84cbf4d3afc7f doDisplay
/compat/vendor/twig/twig/src/Template.php453
14
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
13
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
12
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
11
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
10
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
9
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
8
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
7
Timber\Timber render
/www/sciencewiz_190/public/wp-content/themes/g5_sciencewiz/footer.php30
6
require_once
/www/sciencewiz_190/public/wp-includes/template.php810
5
load_template
/www/sciencewiz_190/public/wp-includes/template.php745
4
locate_template
/www/sciencewiz_190/public/wp-includes/general-template.php92
3
get_footer
/www/sciencewiz_190/public/wp-content/plugins/woocommerce/templates/single-product.php60
2
include
/www/sciencewiz_190/public/wp-includes/template-loader.php106
1
require_once
/www/sciencewiz_190/public/wp-blog-header.php19
0
require
/www/sciencewiz_190/public/index.php17
{% extends '@nucleus/partials/particle.html.twig' %}
 
{% set post = wordpress.call('Timber::get_post') %}
{% set portal = post.get_field('portal') %}
 
{% set term_image = wordpress.call('Timber::get_term', portal.term_id, 'portals') %}
 
{% block particle %}
 
    {% if portal and function('is_single', product) %}
 
    <div class="g-portal-pages">
           
        <h3 class="g-portal-heading"><span>ScienceWiz</span> <span>Portal to Discovery</span> {{ portal.name|raw }}</h3>
        
        <a href="{{ function('get_term_link', portal.term_id) }}" title="{{ portal.name }}">
 
            {% if term_image.portal_image %}
                <img src="{{ term_image.portal_image }}" alt="{{ portal.name }}">
            {% else %}
                <img src="gantry-theme://images/portal_animated_graphic.gif" alt="{{ portal.name }}">
            {% endif %}
 
        </a>
 
        <p>{{ portal.description|raw }}</p>
 
        <a href="{{ function('get_term_link', portal.term_id) }}" title="{{ portal.name }}" class="g-button">Enter Portal</a>
        
    </div>
 
    {% endif %}
 
{% endblock %}
 
<?php
 
namespace Timber;
 
use Timber\Term;
use Timber\Helper;
 
class TermGetter {
    /**
     * @param int|WP_Term|object $term
     * @param string $taxonomy
     * @return Timber\Term|WP_Error|null
     */
    public static function get_term( $term, $taxonomy, $TermClass = '\Timber\Term' ) {
        $term = get_term($term, $taxonomy);
        return new $TermClass($term->term_id, $term->taxonomy);
    }
 
    /**
     * @param string|array $args
     * @param array $maybe_args
     * @param string $TermClass
     * @return mixed
     */
    public static function get_terms( $args = null, $maybe_args = array(), $TermClass = '\Timber\Term' ) {
        if ( is_string($maybe_args) && !strstr($maybe_args, '=') ) {
            //the user is sending the $TermClass in the second argument
            $TermClass = $maybe_args;
        }
        if ( is_string($maybe_args) && strstr($maybe_args, '=') ) {
            parse_str($maybe_args, $maybe_args);
        }
        if ( is_string($args) && strstr($args, '=') ) {
            //a string and a query string!
            $parsed = self::get_term_query_from_query_string($args);
            if ( is_array($maybe_args) ) {
                $parsed->args = array_merge($parsed->args, $maybe_args);
            }
            return self::handle_term_query($parsed->taxonomies, $parsed->args, $TermClass);
        } else if ( is_string($args) ) {
Exception message: Undefined property: WP_Error::$term_id
<?php
 
namespace Timber;
 
use Timber\Term;
use Timber\Helper;
 
class TermGetter {
    /**
     * @param int|WP_Term|object $term
     * @param string $taxonomy
     * @return Timber\Term|WP_Error|null
     */
    public static function get_term( $term, $taxonomy, $TermClass = '\Timber\Term' ) {
        $term = get_term($term, $taxonomy);
        return new $TermClass($term->term_id, $term->taxonomy);
    }
 
    /**
     * @param string|array $args
     * @param array $maybe_args
     * @param string $TermClass
     * @return mixed
     */
    public static function get_terms( $args = null, $maybe_args = array(), $TermClass = '\Timber\Term' ) {
        if ( is_string($maybe_args) && !strstr($maybe_args, '=') ) {
            //the user is sending the $TermClass in the second argument
            $TermClass = $maybe_args;
        }
        if ( is_string($maybe_args) && strstr($maybe_args, '=') ) {
            parse_str($maybe_args, $maybe_args);
        }
        if ( is_string($args) && strstr($args, '=') ) {
            //a string and a query string!
            $parsed = self::get_term_query_from_query_string($args);
            if ( is_array($maybe_args) ) {
                $parsed->args = array_merge($parsed->args, $maybe_args);
            }
            return self::handle_term_query($parsed->taxonomies, $parsed->args, $TermClass);
        } else if ( is_string($args) ) {
     * Get terms.
     * @api
     * @param string|array $args
     * @param array   $maybe_args
     * @param string  $TermClass
     * @return mixed
     */
    public static function get_terms( $args = null, $maybe_args = array(), $TermClass = 'Timber\Term' ) {
        return TermGetter::get_terms($args, $maybe_args, $TermClass);
    }
 
    /**
     * Get term.
     * @api
     * @param int|WP_Term|object $term
     * @param string     $taxonomy
     * @return Timber\Term|WP_Error|null
     */
    public static function get_term( $term, $taxonomy = 'post_tag', $TermClass = 'Timber\Term' ) {
        return TermGetter::get_term($term, $taxonomy, $TermClass);
    }
 
    /* Site Retrieval
    ================================ */
 
    /**
     * Get sites.
     * @api
     * @param array|bool $blog_ids
     * @return array
     */
    public static function get_sites( $blog_ids = false ) {
        if ( !is_array($blog_ids) ) {
            global $wpdb;
            $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs ORDER BY blog_id ASC");
        }
        $return = array();
        foreach ( $blog_ids as $blog_id ) {
            $return[] = new Site($blog_id);
        }
        return $text;
    }
 
    public function finalize()
    {
        $gantry = Gantry::instance();
        /** @var Document $document */
        $document = $gantry['document'];
 
        $document::registerAssets();
    }
 
    /**
     * @return mixed|null
     */
    public function call()
    {
        $args = func_get_args();
        $callable = array_shift($args);
        return is_callable($callable) ? call_user_func_array($callable, $args) : null;
    }
 
    /**
     * @param string $action
     * @param int|string|null $id
     * @return bool
     */
    public function authorize($action, $id = null)
    {
        return true;
    }
 
    /**
     * @param array|string $dependencies
     * @return bool
     * @since 5.4.3
     */
    public function checkDependencies($dependencies)
    {
        if (is_string($dependencies)) {
        return $text;
    }
 
    public function finalize()
    {
        $gantry = Gantry::instance();
        /** @var Document $document */
        $document = $gantry['document'];
 
        $document::registerAssets();
    }
 
    /**
     * @return mixed|null
     */
    public function call()
    {
        $args = func_get_args();
        $callable = array_shift($args);
        return is_callable($callable) ? call_user_func_array($callable, $args) : null;
    }
 
    /**
     * @param string $action
     * @param int|string|null $id
     * @return bool
     */
    public function authorize($action, $id = null)
    {
        return true;
    }
 
    /**
     * @param array|string $dependencies
     * @return bool
     * @since 5.4.3
     */
    public function checkDependencies($dependencies)
    {
        if (is_string($dependencies)) {
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // 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 {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
            }
            @trigger_error($message, \E_USER_DEPRECATED);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
 
        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);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $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);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        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.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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;
        }
    }
 
    {
        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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    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 (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } 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 {
     * @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
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // 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_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($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_num_args() > 1 ? func_get_arg(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
     *
 
        $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.
     */
        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',
     * );
        $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
     * 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
     */
defined('ABSPATH') or die;
 
use Timber\Timber;
 
/*
 * Third party plugins that hijack the theme will call wp_footer() to get the footer template.
 * We use this to end our output buffer (started in header.php) and render into the views/page-plugin.html.twig template.
 */
 
$timberContext = $GLOBALS['timberContext'];
 
if (!isset($timberContext)) {
    throw new \Exception('Timber context not set in footer.');
}
 
$timberContext['content'] = ob_get_contents();
ob_end_clean();
 
$templates = ['page-plugin.html.twig'];
Timber::render($templates, $timberContext);
 
        extract( $wp_query->query_vars, EXTR_SKIP );
    }
 
    if ( isset( $s ) ) {
        $s = esc_attr( $s );
    }
 
    /**
     * Fires before a template file is loaded.
     *
     * @since 6.1.0
     *
     * @param string $_template_file The full path to the template file.
     * @param bool   $load_once      Whether to require_once or require.
     * @param array  $args           Additional arguments passed to the template.
     */
    do_action( 'wp_before_load_template', $_template_file, $load_once, $args );
 
    if ( $load_once ) {
        require_once $_template_file;
    } else {
        require $_template_file;
    }
 
    /**
     * Fires after a template file is loaded.
     *
     * @since 6.1.0
     *
     * @param string $_template_file The full path to the template file.
     * @param bool   $load_once      Whether to require_once or require.
     * @param array  $args           Additional arguments passed to the template.
     */
    do_action( 'wp_after_load_template', $_template_file, $load_once, $args );
}
 
 
    $located = '';
    foreach ( (array) $template_names as $template_name ) {
        if ( ! $template_name ) {
            continue;
        }
        if ( file_exists( $wp_stylesheet_path . '/' . $template_name ) ) {
            $located = $wp_stylesheet_path . '/' . $template_name;
            break;
        } elseif ( $is_child_theme && file_exists( $wp_template_path . '/' . $template_name ) ) {
            $located = $wp_template_path . '/' . $template_name;
            break;
        } elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
            $located = ABSPATH . WPINC . '/theme-compat/' . $template_name;
            break;
        }
    }
 
    if ( $load && '' !== $located ) {
        load_template( $located, $load_once, $args );
    }
 
    return $located;
}
 
/**
 * Requires the template file with WordPress environment.
 *
 * The globals are set up for the template file to ensure that the WordPress
 * environment is available from within the function. The query variables are
 * also available.
 *
 * @since 1.5.0
 * @since 5.5.0 The `$args` parameter was added.
 *
 * @global array      $posts
 * @global WP_Post    $post          Global post object.
 * @global bool       $wp_did_header
 * @global WP_Query   $wp_query      WordPress Query object.
 * @global WP_Rewrite $wp_rewrite    WordPress rewrite component.
     * Fires before the footer template file is loaded.
     *
     * @since 2.1.0
     * @since 2.8.0 The `$name` parameter was added.
     * @since 5.5.0 The `$args` parameter was added.
     *
     * @param string|null $name Name of the specific footer file to use. Null for the default footer.
     * @param array       $args Additional arguments passed to the footer template.
     */
    do_action( 'get_footer', $name, $args );
 
    $templates = array();
    $name      = (string) $name;
    if ( '' !== $name ) {
        $templates[] = "footer-{$name}.php";
    }
 
    $templates[] = 'footer.php';
 
    if ( ! locate_template( $templates, true, true, $args ) ) {
        return false;
    }
}
 
/**
 * Loads sidebar template.
 *
 * Includes the sidebar template for a theme or if a name is specified then a
 * specialized sidebar will be included.
 *
 * For the parameter, if the file is called "sidebar-special.php" then specify
 * "special".
 *
 * @since 1.5.0
 * @since 5.5.0 A return value was added.
 * @since 5.5.0 The `$args` parameter was added.
 *
 * @param string $name The name of the specialized sidebar.
 * @param array  $args Optional. Additional arguments passed to the sidebar template.
 *                     Default empty array.
    <?php
        /**
         * woocommerce_after_main_content hook.
         *
         * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
         */
        do_action( 'woocommerce_after_main_content' );
    ?>
 
    <?php
        /**
         * woocommerce_sidebar hook.
         *
         * @hooked woocommerce_get_sidebar - 10
         */
        do_action( 'woocommerce_sidebar' );
    ?>
 
<?php
get_footer( 'shop' );
 
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
 
            }
 
            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;
}
 
<?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';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.26.2
REQUEST_URI /product/energy-part-2-dl
MAGICK_TEMPORARY_PATH /www/sciencewiz_190/tmp
USER sciencewiz
HOME /www/sciencewiz_190
HTTP_ACCEPT */*
HTTP_CDN_LOOP cloudflare; loops=1; subreqs=1
HTTP_CF_EW_VIA 15
HTTP_CF_WORKER kinsta.cloud
HTTP_CF_CONNECTING_IP 216.73.216.177
HTTP_CF_DEVICE_TYPE desktop
HTTP_KI_REALIP 216.73.216.177
HTTP_KI_REQUEST_COLO 185
HTTP_CF_IPCOUNTRY US
HTTP_CF_VISITOR {\"scheme\":\"https\"}
HTTP_KI_REQUEST_METAL 107
HTTP_X_FORWARDED_PROTO https
HTTP_X_KINSTA_EDGE_INCOMINGIP 216.73.216.177
HTTP_ACCEPT_ENCODING gzip, br
HTTP_X_KINSTA_EDGE_LB KCW
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_X_FORWARDED_FOR 216.73.216.177
HTTP_CF_RAY 947be705d377be76-CMH
SCRIPT_FILENAME /www/sciencewiz_190/public/index.php
REDIRECT_STATUS 200
WP_ENVIRONMENT_TYPE production
KINSTA_CACHE_ZONE KINSTAWP
SERVER_NAME sciencewiz.com
SERVER_PORT 443
SERVER_ADDR 10.0.14.193
REMOTE_PORT
REMOTE_ADDR 216.73.216.177
GATEWAY_INTERFACE CGI/1.1
HTTP_HOST sciencewiz.com
HTTPS on
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/sciencewiz_190/public
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1748583686.198
REQUEST_TIME 1748583686
empty
0. Whoops\Handler\PrettyPageHandler