Whoops \ Exception \ ErrorException (E_NOTICE)
Undefined variable: month Whoops\Exception\ErrorException thrown with message "Undefined variable: month" Stacktrace: #11 Whoops\Exception\ErrorException in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php:320 #10 Whoops\Run:handleError in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php:320 #9 Lexicon\Post\Event:era_id in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php:234 #8 Lexicon\Post\Event:hplex_event_sorter in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php:144 #7 Lexicon\Post\Event:chooseEvents in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Site.php:157 #6 Lexicon\Site:add_to_context in /home/hplex/alchemy.hp-lexicon.org/www/wp-includes/class-wp-hook.php:287 #5 WP_Hook:apply_filters in /home/hplex/alchemy.hp-lexicon.org/www/wp-includes/plugin.php:212 #4 apply_filters in /home/hplex/alchemy.hp-lexicon.org/vendor/timber/timber/lib/Timber.php:269 #3 Timber\Timber:get_context in /home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/single-event.php:16 #2 include in /home/hplex/alchemy.hp-lexicon.org/www/wp-includes/template-loader.php:106 #1 require_once in /home/hplex/alchemy.hp-lexicon.org/www/wp-blog-header.php:19 #0 require in /home/hplex/alchemy.hp-lexicon.org/www/index.php:17
Stack frames (12)
11
Whoops\Exception\ErrorException
/wp-content/themes/lexicon/lib/Post/Event.php320
10
Whoops\Run handleError
/wp-content/themes/lexicon/lib/Post/Event.php320
9
Lexicon\Post\Event era_id
/wp-content/themes/lexicon/lib/Post/Event.php234
8
Lexicon\Post\Event hplex_event_sorter
/wp-content/themes/lexicon/lib/Post/Event.php144
7
Lexicon\Post\Event chooseEvents
/wp-content/themes/lexicon/lib/Site.php157
6
Lexicon\Site add_to_context
/www/wp-includes/class-wp-hook.php287
5
WP_Hook apply_filters
/www/wp-includes/plugin.php212
4
apply_filters
/vendor/timber/timber/lib/Timber.php269
3
Timber\Timber get_context
/wp-content/themes/lexicon/single-event.php16
2
include
/www/wp-includes/template-loader.php106
1
require_once
/www/wp-blog-header.php19
0
require
/www/index.php17
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php
            if ($year < 1959) {
                if ($year < 1920) {
                    return "7100";
                } elseif ($year >= 1920 && $year <= 1945) {
                    return "7110";
                }
                return "7120";
            }
            if ($year < 1999) {
                if ($year >= 1970 && $year < 1981) {
                    return "7210";
                }
                if ($year >= 1981 && $year < 1990) {
                    return "7220";
                }
                if ($year >= 1990 && $year <= 1998) {
                    if ($year == 1991) {
                        return "7231";
                    }
                    if ($year == 1992 && (!trim($month) || $month < 7)) {
                        return "7231";
                    }
                    if ($year == 1992) {
                        return "7232";
                    }
                    if ($year == 1993 && (!trim($month) || $month < 7)) {
                        return "7232";
                    }
                    if ($year == 1993) {
                        return "7233";
                    }
                    if ($year == 1994 && (!trim($month) || $month < 7)) {
                        return "7233";
                    }
                    if ($year == 1994) {
                        return "7234";
                    }
                    if ($year == 1995 && (!trim($month) || $month < 7)) {
                        return "7234";
                    }
Arguments
  1. "Undefined variable: month"
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php
            if ($year < 1959) {
                if ($year < 1920) {
                    return "7100";
                } elseif ($year >= 1920 && $year <= 1945) {
                    return "7110";
                }
                return "7120";
            }
            if ($year < 1999) {
                if ($year >= 1970 && $year < 1981) {
                    return "7210";
                }
                if ($year >= 1981 && $year < 1990) {
                    return "7220";
                }
                if ($year >= 1990 && $year <= 1998) {
                    if ($year == 1991) {
                        return "7231";
                    }
                    if ($year == 1992 && (!trim($month) || $month < 7)) {
                        return "7231";
                    }
                    if ($year == 1992) {
                        return "7232";
                    }
                    if ($year == 1993 && (!trim($month) || $month < 7)) {
                        return "7232";
                    }
                    if ($year == 1993) {
                        return "7233";
                    }
                    if ($year == 1994 && (!trim($month) || $month < 7)) {
                        return "7233";
                    }
                    if ($year == 1994) {
                        return "7234";
                    }
                    if ($year == 1995 && (!trim($month) || $month < 7)) {
                        return "7234";
                    }
Arguments
  1. 8
    
  2. "Undefined variable: month"
    
  3. "/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php"
    
  4. 320
    
  5. array:1 [
      "year" => "1992"
    ]
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php
    public function hplex_monthday()
    {
        $monthDay = "";
        if ($this->month) {
            $monthDay .= sprintf("%02d", $this->month);
            if ($this->day) {
                $monthDay .= "-" . sprintf("%02d", $this->day);
            }
        }
 
        if ($this->hplex_monthday != $monthDay) {
            update_post_meta($this->ID, "hplex_monthday", $monthDay);
        }
    }
 
 
    public function hplex_event_sorter()
    {
        $sorterString = "";
        $sorterString .= $this->era_id();
 
        $year = $this->baseYear();
        if ($year < 0) {
            $year *= -1;
        }
 
        $sorterString .= sprintf("%04d", $year);
 
        if ($this->month) {
            $sorterString .= sprintf("%02d", $this->month);
            if ($this->day) {
                $sorterString .= sprintf("%02d", $this->day);
            } else {
                $sorterString .= "00";
            }
        } else {
            $sorterString .= "0000";
        }
        $sorterString .= $this->timeOfDaySorter();
 
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Post/Event.php
        $types = ['Wizarding world', 'Muggle world'];
 
        if (!in_array($this->type_of_event, $types)) {
            $typeCompare = '=';
            $types = $this->type_of_event;
        }
 
        $args = array(
            'post_type'         =>  'event',
            'post_status'       =>  'publish',
            'orderby'           =>  'hplex_event_sorter',
            'order'             =>  'DESC',
            'posts_per_page'    =>  $this->timelineEventsPerSide,
            'post__not_in'      =>  array($this->id),
            'meta_query'        =>  [
                'relation'    => 'AND',
                'hplex_event_sorter'    =>  [
                    'key'       =>  'hplex_event_sorter',
                    'compare'   =>  '<=',
                    'value'     =>  $this->hplex_event_sorter(),
                    'type'      => 'NUMERIC',
                ],
                'type_of_event' =>  [
                    'key'       =>  'type_of_event',
                    'compare'   =>  $typeCompare,
                    'value'     =>  $types
                ]
            ],
        );
 
        $pastEvents = Timber::get_posts($args, 'Lexicon\Post\Event');
        foreach ($pastEvents as $event) {
            $this->addTimelineEvent($event, array('past', 'important'));
        }
 
        $this->addTimelineEvent($this, array('current', 'important'));
 
        $args['meta_query']['hplex_event_sorter']['compare'] = '>=';
        $args['order'] = 'ASC';
        $args['post__not_in'] = array_keys($this->timeline_events);
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/lib/Site.php
            if ($post->post_parent) {
                $artist = new \Lexicon\Post\GuestAuthor($post->post_parent);
                if ($artist->post_type == 'guest-author') {
                    $context['artists'][$post->post_parent] = $artist;
                }
            }
 
            if (!$context['artists'] && $post->artist) {
                $artists = $post->artist;
                if (!is_array($artists)) {
                    $artists = [$artists];
                }
                foreach ($artists as $artist) {
                    $context['artists'][$artist] = new \Lexicon\Post\GuestAuthor($artist);
                }
            }
        } elseif ($context['is_single']) {
            $post = Timber::query_post(null, $this->singleContentType());
 
            $context['timeline_events'] = $post->chooseEvents();
            $context['canon_references'] = $post->canon_references();
            $context['icons'] = $post->icons;
 
            //$context['comment_form'] = \Timber\Helper::get_comment_form();
            $context['post'] = $post;
            $context['share_url'] = $post->link();
            $context['short_url'] = wp_get_shortlink($post->ID);
            $context['tweet_text'] = $post->title();
 
            if ($post->post_type == 'source') {
                $context['prev_chapter'] = $post->prev_chapter();
                $context['next_chapter'] = $post->next_chapter();
            }
 
            $context = $post->add_to_context($context);
        } else {
            $context['share_url'] = 'http://www.hp-lexicon.org/';
            $context['short_url'] = 'http://hplex.org';
            $context['tweet_text'] = "The Harry Potter Lexicon";
        }
/home/hplex/alchemy.hp-lexicon.org/www/wp-includes/class-wp-hook.php
 
        $nesting_level = $this->nesting_level++;
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
            $priority                                 = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 == $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
Arguments
  1. array:12 [
      "http_host" => "https://alchemy.hp-lexicon.org"
      "wp_title" => "Harry and Ron use Polyjuice Potion to &quot;become&quot; Crabbe and Goyle. &ndash; Harry Potter Lexicon"
      "body_class" => "event-template-default single single-event postid-4128"
      "site" => Timber\Site {#2756}
      "request" => Timber\Request {#2754}
      "user" => false
      "theme" => Timber\Theme {#2777}
      "posts" => Timber\PostQuery {#2752
        +found_posts: 1
        #userQuery: false
        #queryIterator: Timber\QueryIterator {#2751}
        #pagination: null
        storage: array:1 [
          0 => Timber\Post {#2749}
        ]
        flag::STD_PROP_LIST: false
        flag::ARRAY_AS_PROPS: false
        iteratorClass: "Timber\PostsIterator"
      }
      "wp_head" => Timber\FunctionWrapper {#2750}
      "wp_footer" => Timber\FunctionWrapper {#2747}
      "is_single" => true
      "is_attachment" => false
    ]
    
/home/hplex/alchemy.hp-lexicon.org/www/wp-includes/plugin.php
    if ( isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
        _wp_call_all_hook( $args );
    }
 
    if ( ! isset( $wp_filter[ $tag ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
        return $value;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
    }
 
    // Don't pass the tag name to WP_Hook.
    array_shift( $args );
 
    $filtered = $wp_filter[ $tag ]->apply_filters( $value, $args );
 
    array_pop( $wp_current_filter );
 
    return $filtered;
}
 
/**
 * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
 *
 * @since 3.0.0
 *
 * @see apply_filters() This function is identical, but the arguments passed to the
 * functions hooked to `$tag` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $tag  The name of the filter hook.
 * @param array  $args The arguments supplied to the functions hooked to $tag.
 * @return mixed The filtered value after all hooked functions are applied to it.
Arguments
  1. array:10 [
      "http_host" => "https://alchemy.hp-lexicon.org"
      "wp_title" => "Harry and Ron use Polyjuice Potion to &quot;become&quot; Crabbe and Goyle. &ndash; Harry Potter Lexicon"
      "body_class" => "event-template-default single single-event postid-4128"
      "site" => Timber\Site {#2756}
      "request" => Timber\Request {#2754}
      "user" => false
      "theme" => Timber\Theme {#2777}
      "posts" => Timber\PostQuery {#2752
        +found_posts: 1
        #userQuery: false
        #queryIterator: Timber\QueryIterator {#2751}
        #pagination: null
        storage: array:1 [
          0 => Timber\Post {#2749}
        ]
        flag::STD_PROP_LIST: false
        flag::ARRAY_AS_PROPS: false
        iteratorClass: "Timber\PostsIterator"
      }
      "wp_head" => Timber\FunctionWrapper {#2750}
      "wp_footer" => Timber\FunctionWrapper {#2747}
    ]
    
  2. array:1 [
      0 => array:10 [
        "http_host" => "https://alchemy.hp-lexicon.org"
        "wp_title" => "Harry and Ron use Polyjuice Potion to &quot;become&quot; Crabbe and Goyle. &ndash; Harry Potter Lexicon"
        "body_class" => "event-template-default single single-event postid-4128"
        "site" => Timber\Site {#2756}
        "request" => Timber\Request {#2754}
        "user" => false
        "theme" => Timber\Theme {#2777}
        "posts" => Timber\PostQuery {#2752
          +found_posts: 1
          #userQuery: false
          #queryIterator: Timber\QueryIterator {#2751}
          #pagination: null
          storage: array:1 [
            0 => Timber\Post {#2749}
          ]
          flag::STD_PROP_LIST: false
          flag::ARRAY_AS_PROPS: false
          iteratorClass: "Timber\PostsIterator"
        }
        "wp_head" => Timber\FunctionWrapper {#2750}
        "wp_footer" => Timber\FunctionWrapper {#2747}
      ]
    ]
    
/home/hplex/alchemy.hp-lexicon.org/vendor/timber/timber/lib/Timber.php
            self::$context_cache['http_host'] = URLHelper::get_scheme().'://'.URLHelper::get_host();
            self::$context_cache['wp_title'] = Helper::get_wp_title();
            self::$context_cache['body_class'] = implode(' ', get_body_class());
 
            self::$context_cache['site'] = new Site();
            self::$context_cache['request'] = new Request();
            $user = new User();
            self::$context_cache['user'] = ($user->ID) ? $user : false;
            self::$context_cache['theme'] = self::$context_cache['site']->theme;
 
            self::$context_cache['posts'] = new PostQuery();
 
            /**
             * @deprecated as of Timber 1.3.0
             * @todo remove in Timber 1.4.*
             */
            self::$context_cache['wp_head'] = new FunctionWrapper( 'wp_head' );
            self::$context_cache['wp_footer'] = new FunctionWrapper( 'wp_footer' );
 
            self::$context_cache = apply_filters('timber_context', self::$context_cache);
            self::$context_cache = apply_filters('timber/context', self::$context_cache);
        }
 
 
        return self::$context_cache;
    }
 
    /**
     * Compile a Twig file.
     *
     * Passes data to a Twig file and returns the output.
     * If the template file doesn't exist it will throw a warning when WP_DEBUG is enabled.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'firstname' => 'Jane',
     *     'lastname' => 'Doe',
     *     'email' => '[email protected]',
Arguments
  1. "timber_context"
    
  2. array:10 [
      "http_host" => "https://alchemy.hp-lexicon.org"
      "wp_title" => "Harry and Ron use Polyjuice Potion to &quot;become&quot; Crabbe and Goyle. &ndash; Harry Potter Lexicon"
      "body_class" => "event-template-default single single-event postid-4128"
      "site" => Timber\Site {#2756}
      "request" => Timber\Request {#2754}
      "user" => false
      "theme" => Timber\Theme {#2777}
      "posts" => Timber\PostQuery {#2752
        +found_posts: 1
        #userQuery: false
        #queryIterator: Timber\QueryIterator {#2751}
        #pagination: null
        storage: array:1 [
          0 => Timber\Post {#2749}
        ]
        flag::STD_PROP_LIST: false
        flag::ARRAY_AS_PROPS: false
        iteratorClass: "Timber\PostsIterator"
      }
      "wp_head" => Timber\FunctionWrapper {#2750}
      "wp_footer" => Timber\FunctionWrapper {#2747}
    ]
    
/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/single-event.php
<?php
use Timber\Timber;
use Carbon\Carbon;
use Lexicon\Currency\Converter;
 
/**
 * The Template for displaying all single posts
 *
 * Methods for TimberHelper can be found in the /lib sub-directory
 *
 * @package  WordPress
 * @subpackage  Timber
 * @since    Timber 0.1
 */
 
$data = Timber::get_context();
 
$data['type'] = $data['type_info'] = $data['post']->type();
$data['iconbanners'] = $data['post']->iconBanners();
 
$visibleCurrencies = commonCurrencies();
 
 
if (isset($data['post']->year) && $data['post']->date_type == 'full') {
    $data['hplex_datetime'] = $date = new Carbon($data['post']->hplex_datetime());
 
    if ($date->gte(new Carbon('1971-01-01')) && $date->lte(new Carbon())) {
        $converter = new Converter();
        $data['currency_rates'] = $converter->wizardToMuggleAll(1, 0, 0, $date, $visibleCurrencies);
    }
}
 
if (isset($_REQUEST['debug']) && $_REQUEST['debug'] == 'breakthisnick') {
    dump($data['hplex_datetime']);
    dump($data['currency_rates']);
    dd($data);
}
 
if (post_password_required($data['post']->ID)) {
    Timber::render('single-password.twig', $data);
/home/hplex/alchemy.hp-lexicon.org/www/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;
}
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/wp-content/themes/lexicon/single-event.php"
    
/home/hplex/alchemy.hp-lexicon.org/www/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';
 
}
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/www/wp-includes/template-loader.php"
    
/home/hplex/alchemy.hp-lexicon.org/www/index.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';
 
Arguments
  1. "/home/hplex/alchemy.hp-lexicon.org/www/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache/2.4.43 (Ubuntu)"
REQUEST_URI
"/event/december-25-1992-harry-and-ron-use-polyjuice/"
USER
"www-data"
HOME
"/var/www"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/event/december-25-1992-harry-and-ron-use-polyjuice/"
REMOTE_PORT
"30298"
SCRIPT_FILENAME
"/home/hplex/alchemy.hp-lexicon.org/www/index.php"
SERVER_ADMIN
"[no address given]"
CONTEXT_DOCUMENT_ROOT
"/home/hplex/alchemy.hp-lexicon.org/www"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/home/hplex/alchemy.hp-lexicon.org/www"
REMOTE_ADDR
"3.237.66.86"
SERVER_PORT
"443"
SERVER_ADDR
"10.138.0.2"
SERVER_NAME
"alchemy.hp-lexicon.org"
SERVER_SIGNATURE
"<address>Apache/2.4.43 (Ubuntu) Server at alchemy.hp-lexicon.org Port 443</address>\n"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
HTTP_CDN_LOOP
"cloudflare"
HTTP_CF_CONNECTING_IP
"3.237.66.86"
HTTP_CF_REQUEST_ID
"06a5037f5800000cd5743ca000000001"
HTTP_IF_MODIFIED_SINCE
"Sat, 26 Sep 2020 02:37:13 GMT"
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_CF_VISITOR
"{\"scheme\":\"https\"}"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_CF_RAY
"5f81d5122f430cd5-EWR"
HTTP_CF_IPCOUNTRY
"US"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_CONNECTION
"Keep-Alive"
HTTP_HOST
"alchemy.hp-lexicon.org"
proxy-nokeepalive
"1"
SSL_TLS_SNI
"alchemy.hp-lexicon.org"
HTTPS
"on"
proxyssl
"1"
REDIRECT_STATUS
"200"
REDIRECT_SSL_TLS_SNI
"alchemy.hp-lexicon.org"
REDIRECT_HTTPS
"on"
REDIRECT_proxyssl
"1"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1606375073.8252
REQUEST_TIME
1606375073
HTTP_X_FORWARDED_FOR
"3.237.66.86"
empty
0. Whoops\Handler\PrettyPageHandler