TypeError
array_values(): Argument #1 ($array) must be of type array, null given TypeError thrown with message "array_values(): Argument #1 ($array) must be of type array, null given" Stacktrace: #13 TypeError in /home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/functions/menu-functions.php:25 #12 array_values in /home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/functions/menu-functions.php:25 #11 get_nav_menu_items_by_location in /home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/controllers/AppController.php:95 #10 Theme\Controllers\AppController:displayMainMenu in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/class-wp-hook.php:341 #9 WP_Hook:apply_filters in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/class-wp-hook.php:365 #8 WP_Hook:do_action in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/plugin.php:522 #7 do_action in /home/runcloud/webapps/app-highfield/web/app/themes/highfield/header.php:186 #6 require_once in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/template.php:814 #5 load_template in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/template.php:749 #4 locate_template in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/general-template.php:48 #3 get_header in /home/runcloud/webapps/app-highfield/web/app/themes/highfield/page.php:1 #2 include in /home/runcloud/webapps/app-highfield/web/wp/wp-includes/template-loader.php:132 #1 require_once in /home/runcloud/webapps/app-highfield/web/wp/wp-blog-header.php:19 #0 require in /home/runcloud/webapps/app-highfield/web/index.php:6
Stack frames (14)
13
TypeError
/web/app/themes/highfield/resources/functions/menu-functions.php25
12
array_values
/web/app/themes/highfield/resources/functions/menu-functions.php25
11
get_nav_menu_items_by_location
/web/app/themes/highfield/resources/controllers/AppController.php95
10
Theme\Controllers\AppController displayMainMenu
/web/wp/wp-includes/class-wp-hook.php341
9
WP_Hook apply_filters
/web/wp/wp-includes/class-wp-hook.php365
8
WP_Hook do_action
/web/wp/wp-includes/plugin.php522
7
do_action
/web/app/themes/highfield/header.php186
6
require_once
/web/wp/wp-includes/template.php814
5
load_template
/web/wp/wp-includes/template.php749
4
locate_template
/web/wp/wp-includes/general-template.php48
3
get_header
/web/app/themes/highfield/page.php1
2
include
/web/wp/wp-includes/template-loader.php132
1
require_once
/web/wp/wp-blog-header.php19
0
require
/web/index.php6
/home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/functions/menu-functions.php
     */
    function get_nav_menu_items_by_location( $location, $args = [] ) {
        // Get all locations
        $locations = get_nav_menu_locations();
        // Get object id by location
        $object = wp_get_nav_menu_object( $locations[$location] );
        // Get menu items by menu name
        $menu_items = wp_get_nav_menu_items( $object->name, $args );
        $the_menu_items;
        foreach($menu_items as $item) {
            $item->children = [];
            $item->path = parse_url($item->url, PHP_URL_PATH);
            if($item->menu_item_parent) {
                 $the_menu_items[$item->menu_item_parent]->children[] = $item;
            } else { 
                $the_menu_items[$item->ID] = $item;
            }  
        }
        // Return menu post objects
        return array_values($the_menu_items);
    }
 
Arguments
  1. "array_values(): Argument #1 ($array) must be of type array, null given"
    
/home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/functions/menu-functions.php
     */
    function get_nav_menu_items_by_location( $location, $args = [] ) {
        // Get all locations
        $locations = get_nav_menu_locations();
        // Get object id by location
        $object = wp_get_nav_menu_object( $locations[$location] );
        // Get menu items by menu name
        $menu_items = wp_get_nav_menu_items( $object->name, $args );
        $the_menu_items;
        foreach($menu_items as $item) {
            $item->children = [];
            $item->path = parse_url($item->url, PHP_URL_PATH);
            if($item->menu_item_parent) {
                 $the_menu_items[$item->menu_item_parent]->children[] = $item;
            } else { 
                $the_menu_items[$item->ID] = $item;
            }  
        }
        // Return menu post objects
        return array_values($the_menu_items);
    }
 
/home/runcloud/webapps/app-highfield/web/app/themes/highfield/resources/controllers/AppController.php
        }
 
        public function displayHeaderToolbar() {
            echo view( 'app/header-toolbar', ['items' => get_nav_menu_items_by_location('header-toolbar')] );            
        }
 
        public function displayHeaderToolbarMobile() {
            echo view( 'app/header-toolbar_mobile', ['items' => get_nav_menu_items_by_location('header-toolbar')] );            
        }
 
        public function displayFooterQuickLinks() {
            echo view( 'app/footer-quick-links', ['items' => get_nav_menu_items_by_location('quick-links')] ); 
        }
 
        public function displayFooterMenu() {
            echo view( 'app/footer-menu', ['items' => get_nav_menu_items_by_location('footer-menu')] ); 
        }
 
        public function displayMainMenu() {
            echo view( 'app/main-menu', ['items' => get_nav_menu_items_by_location('main-menu')] ); 
        }
 
        public function displayMobileMenu() {
            echo view( 'app/main-menu_mobile', ['items' => get_nav_menu_items_by_location('main-menu')] );
        }
 
        public static function renderBlock($block, $inner_blocks) {
            
            echo view('blocks.' . $block['name'], compact('block', 'inner_blocks'));
            
        }
        
    
    }
    
 
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/class-wp-hook.php
 
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        $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, $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.
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/class-wp-hook.php
        } 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.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/plugin.php
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    if ( empty( $arg ) ) {
        $arg[] = '';
    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
        $arg[0] = $arg[0][0];
    }
 
    $wp_filter[ $hook_name ]->do_action( $arg );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Calls the callback functions that have been added to an action hook, specifying arguments in an array.
 *
 * @since 2.1.0
 *
 * @see do_action() This function is identical, but the arguments passed to the
 *                  functions hooked to `$hook_name` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $hook_name The name of the action to be executed.
 * @param array  $args      The arguments supplied to the functions hooked to `$hook_name`.
 */
function do_action_ref_array( $hook_name, $args ) {
/home/runcloud/webapps/app-highfield/web/app/themes/highfield/header.php
                                <a href="https://highbrook.parents.isamshosting.cloud/#/" target="_blank">
                                    Parent Portal
                                    <i class="fak fa-hb-parent"></i>
                                </a>
                            </div>
 
                            <div>
                                <!-- Search -->
                                <a href="/?s="><i class="fak fa-hb-search"></i></a>
                            </div>
 
                            <div class="js_open-menu">
                                <span class="show-for-xlarge">Close</span>
                                <i class="fak fa-hb-close"></i>
                            </div>
                        </div>
 
                        <div class="menu  cell small-12 ">
                            <div class="grid-x width-100 show-for-medium">
                                <?php do_action( "app_main_menu" ); ?>
                            </div>
 
                            <div class="width-100 hide-for-medium">
                                <?php do_action( "app_main_menu_mobile" ); ?>
                            </div>
                        </div>
 
                        <div class="social  cell small-12">
                            <?php
                            if ( have_rows( "footer_social", "option" ) ) :
                                while ( have_rows( "footer_social", "option" ) ) :
                                    the_row();
                                    $Link = get_sub_field( "link" ); ?>
                                    <div class="social__icon">
                                        <a href="<?= $Link[ "url" ]; ?>" target="<?= $Link[ "target" ]; ?>"><img src="<?= the_sub_field( "logo" ); ?>"></a>
                                    </div>
                                <?php
                                endwhile;
                            endif; ?>
 
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/template.php
        extract( $wp_query->query_vars, EXTR_SKIP );
    }
 
    if ( isset( $s ) ) {
        $s = esc_attr( $s ); // @phpstan-ignore variable.undefined (It's extracted from query vars.)
    }
 
    /**
     * 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 );
}
 
/**
 * Checks whether the template should be output buffered for enhancement.
 *
 * By default, an output buffer is only started if a {@see 'wp_template_enhancement_output_buffer'} filter has been
Arguments
  1. "/home/runcloud/webapps/app-highfield/web/app/themes/highfield/header.php"
    
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/template.php
 
    $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.
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/general-template.php
     * Fires before the header 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 header file to use. Null for the default header.
     * @param array       $args Additional arguments passed to the header template.
     */
    do_action( 'get_header', $name, $args );
 
    $templates = array();
    $name      = (string) $name;
    if ( '' !== $name ) {
        $templates[] = "header-{$name}.php";
    }
 
    $templates[] = 'header.php';
 
    if ( ! locate_template( $templates, true, true, $args ) ) {
        return false;
    }
}
 
/**
 * Loads footer template.
 *
 * Includes the footer template for a theme or if a name is specified then a
 * specialized footer will be included.
 *
 * For the parameter, if the file is called "footer-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|null $name The name of the specialized footer. Default null.
 * @param array       $args Optional. Additional arguments passed to the footer template.
 *                          Default empty array.
/home/runcloud/webapps/app-highfield/web/app/themes/highfield/page.php
<?php get_header(); ?>
 
<!--------------------------------------------------------->
<!--  Index  -->
<!--------------------------------------------------------->
 
<div class="grid-container full">
    <div class="grid-x">
        <?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
        
            <div class="cell small-12">
                
                <article <?php post_class(); ?>>
                    
                    <?php the_content(); ?>
                    
                </article>
                
            </div>
                    
        <?php endwhile; endif; ?>
    </div>
</div>
 
<?php get_footer(); ?>
 
/home/runcloud/webapps/app-highfield/web/wp/wp-includes/template-loader.php
     */
    $template   = apply_filters( 'template_include', $template );
    $is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
    $template   = $is_stringy ? realpath( (string) $template ) : null;
    if (
        is_string( $template ) &&
        ( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
        is_file( $template ) &&
        is_readable( $template )
    ) {
        /**
         * Fires immediately before including the template.
         *
         * @since 6.9.0
         *
         * @param string $template The path of the template about to be included.
         */
        do_action( 'wp_before_include_template', $template );
 
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
Arguments
  1. "/home/runcloud/webapps/app-highfield/web/app/themes/highfield/page.php"
    
/home/runcloud/webapps/app-highfield/web/wp/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/runcloud/webapps/app-highfield/web/wp/wp-includes/template-loader.php"
    
/home/runcloud/webapps/app-highfield/web/index.php
<?php
/**
 * WordPress View Bootstrapper
 */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
 
Arguments
  1. "/home/runcloud/webapps/app-highfield/web/wp/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
Key Value
PHPSESSID
"4be2981dcb5cf5e89a13b0c9a0cee3ac"
Key Value
TrafficSource
"direct"
LandingPage
"https://highfieldandbrookham.co.uk/robots.txt"
TrafficUtms
[]
TrafficUtmsId
[]
Key Value
SERVER_SOFTWARE
"Apache/2.4.67 (Unix) OpenSSL/1.1.1f"
REQUEST_URI
"/boarding/"
USER
"runcloud"
HOME
"/home/runcloud"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/boarding/"
REMOTE_PORT
"49700"
SCRIPT_FILENAME
"/home/runcloud/webapps/app-highfield/web/index.php"
SERVER_ADMIN
"you@example.com"
CONTEXT_DOCUMENT_ROOT
"/home/runcloud/webapps/app-highfield/web/"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"http"
DOCUMENT_ROOT
"/home/runcloud/webapps/app-highfield/web/"
REMOTE_ADDR
"216.73.217.60"
SERVER_PORT
"80"
SERVER_ADDR
"127.0.0.1"
SERVER_NAME
"highfieldandbrookham.co.uk"
SERVER_SIGNATURE
""
LD_LIBRARY_PATH
"/RunCloud/Packages/apache2-rc/lib"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
HTTP_COOKIE
"PHPSESSID=4be2981dcb5cf5e89a13b0c9a0cee3ac"
HTTP_REFERER
"https://highfieldandbrookham.co.uk/boarding"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_FORWARDED_FOR
"216.73.217.60"
HTTP_X_SERVER_ADDR
"159.65.22.205"
HTTP_HOST
"highfieldandbrookham.co.uk"
HTTP_AUTHORIZATION
""
HTTPS
"on"
REDIRECT_STATUS
"200"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_HTTPS
"on"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1785762363.2546
REQUEST_TIME
1785762363
ACF_PRO_KEY
"b3JkZXJfaWQ9NzQ0MjN8dHlwZT1wZXJzb25hbHxkYXRlPTIwMTYtMDItMDYgMDE6MjM6NDg="
AUTH_KEY
"generateme"
AUTH_SALT
"generateme"
DB_NAME
"dleifhgih_db"
DB_PASSWORD
"8qrlpHD0"
DB_USER
"dleifhgih_user"
GRAVITY_FORMS_KEY
"f43370dce9048a9f0c159dae69c579c8"
LOGGED_IN_KEY
"generateme"
LOGGED_IN_SALT
"generateme"
NONCE_KEY
"generateme"
NONCE_SALT
"generateme"
SECURE_AUTH_KEY
"generateme"
SECURE_AUTH_SALT
"generateme"
WP_DEBUG_LOG
"/web/wp"
WP_ENV
"production"
WP_HOME
"https://highfieldandbrookham.co.uk"
WP_SITEURL
"https://highfieldandbrookham.co.uk/wp"
Key Value
ACF_PRO_KEY
"b3JkZXJfaWQ9NzQ0MjN8dHlwZT1wZXJzb25hbHxkYXRlPTIwMTYtMDItMDYgMDE6MjM6NDg="
AUTH_KEY
"generateme"
AUTH_SALT
"generateme"
DB_NAME
"dleifhgih_db"
DB_PASSWORD
"8qrlpHD0"
DB_USER
"dleifhgih_user"
GRAVITY_FORMS_KEY
"f43370dce9048a9f0c159dae69c579c8"
LOGGED_IN_KEY
"generateme"
LOGGED_IN_SALT
"generateme"
NONCE_KEY
"generateme"
NONCE_SALT
"generateme"
SECURE_AUTH_KEY
"generateme"
SECURE_AUTH_SALT
"generateme"
WP_DEBUG_LOG
"/web/wp"
WP_ENV
"production"
WP_HOME
"https://highfieldandbrookham.co.uk"
WP_SITEURL
"https://highfieldandbrookham.co.uk/wp"
0. Whoops\Handler\PrettyPageHandler