Whoops \ Exception \ ErrorException (E_NOTICE)
Trying to access array offset on value of type null Whoops\Exception\ErrorException thrown with message "Trying to access array offset on value of type null" Stacktrace: #4 Whoops\Exception\ErrorException in /var/www/html/public/content/themes/pbc/single.php:68 #3 Whoops\Run:handleError in /var/www/html/public/content/themes/pbc/single.php:68 #2 include in /var/www/html/public/wordpress/wp-includes/template-loader.php:106 #1 require_once in /var/www/html/public/wordpress/wp-blog-header.php:19 #0 require in /var/www/html/public/index.php:14
4
Whoops\Exception\ErrorException
/public/content/themes/pbc/single.php68
3
Whoops\Run handleError
/public/content/themes/pbc/single.php68
2
include
/public/wordpress/wp-includes/template-loader.php106
1
require_once
/public/wordpress/wp-blog-header.php19
0
require
/public/index.php14
/var/www/html/public/content/themes/pbc/single.php
    $reArranged = [];
 
    foreach($categories as $cat){
        if($cat->name == 'Cartoons'){
            $context['post']->category = $cat;
            $isAltered = 'cartoon';
            array_unshift($reArranged,$cat);
        }else if($cat->name == 'Endgames' && $isAltered != 'cartoon'){
            $context['post']->category = $cat;
            $isAltered = 'puzzle';
            array_unshift($reArranged,$cat);
        }else{
            $reArranged[] = $cat;
        }
    }
    $context['post']->categories = $reArranged;
 
    if($isAltered == 'puzzle'){
        $dl = get_field('download_file');
        if($dl['subtype'] == 'pdf') $context['puzzle_embed'] = $dl['url'];
    }
 
    add_filter( 'wpseo_json_ld_output', '__return_false' );
    add_action( 'single_session_ld', 'single_session_ld',10,7 );
 
    function single_session_ld($title,$thumb,$author,$excerpt,$pub,$mod,$logo){
        echo '<script type="application/ld+json">
        {
          "@context": "https://schema.org",
          "@type": "NewsArticle",
          "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https://example.org/article"
          },
          "headline": "'.$title.'",
          "image": "'.$thumb.'",
          "datePublished": "'.$pub.'",
          "dateModified": "'.$mod.'",
          "author": {
            "@type": "Person",
/var/www/html/public/content/themes/pbc/single.php
    $reArranged = [];
 
    foreach($categories as $cat){
        if($cat->name == 'Cartoons'){
            $context['post']->category = $cat;
            $isAltered = 'cartoon';
            array_unshift($reArranged,$cat);
        }else if($cat->name == 'Endgames' && $isAltered != 'cartoon'){
            $context['post']->category = $cat;
            $isAltered = 'puzzle';
            array_unshift($reArranged,$cat);
        }else{
            $reArranged[] = $cat;
        }
    }
    $context['post']->categories = $reArranged;
 
    if($isAltered == 'puzzle'){
        $dl = get_field('download_file');
        if($dl['subtype'] == 'pdf') $context['puzzle_embed'] = $dl['url'];
    }
 
    add_filter( 'wpseo_json_ld_output', '__return_false' );
    add_action( 'single_session_ld', 'single_session_ld',10,7 );
 
    function single_session_ld($title,$thumb,$author,$excerpt,$pub,$mod,$logo){
        echo '<script type="application/ld+json">
        {
          "@context": "https://schema.org",
          "@type": "NewsArticle",
          "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https://example.org/article"
          },
          "headline": "'.$title.'",
          "image": "'.$thumb.'",
          "datePublished": "'.$pub.'",
          "dateModified": "'.$mod.'",
          "author": {
            "@type": "Person",
/var/www/html/public/wordpress/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
/var/www/html/public/wordpress/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
/var/www/html/public/index.php
<?php
 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 
// WordPress view bootstrapper
define( 'WP_USE_THEMES', true );
 
// composer auto loader, symlinks all colliding, this should resolve the relative include paths correctly
//chdir( dirname ( realpath ( __FILE__ ) ) );
 
//require( '../vendor/autoload.php' );
require( './wordpress/wp-blog-header.php');

Environment & details:

empty
empty
empty
empty
Key Value
signup-auth 16266471600335552bcf58.02554857
Key Value
SERVER_SOFTWARE nginx/1.18.0
REQUEST_URI /magazine/puzzles-and-enigmas-by-barry-r-clarke-issue-241
USER nobody
HOME /
HTTP_ACCEPT_ENCODING br,gzip
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-60033555-2b42b8026a012e4a383c434f
HTTP_HOST www.prospectmagazine.co.uk
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 3.239.236.140
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 63448
REMOTE_ADDR 172.31.0.255
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT ********************
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME ******************************
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1610822997.1474
REQUEST_TIME 1610822997
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST *******************************************************************************
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-afce5066
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME 23a82c2d05ee
MAGICK_HOME /usr
MOUNT_DIRECTORY /efs
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHP_INI_DIR /etc/php7
PWD /var/www/html
SESSION_SAVE_HANDLER redis
SHLVL 1
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
Key Value
COMPOSER_ALLOW_SUPERUSER 1
DB_HOST *******************************************************************************
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-afce5066
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME 23a82c2d05ee
MAGICK_HOME /usr
MOUNT_DIRECTORY /efs
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHP_INI_DIR /etc/php7
PWD /var/www/html
SESSION_SAVE_HANDLER redis
SHLVL 1
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
0. Whoops\Handler\PrettyPageHandler