Whoops \ Exception \ ErrorException (E_WARNING)
Undefined array key 0 Whoops\Exception\ErrorException thrown with message "Undefined array key 0" Stacktrace: #8 Whoops\Exception\ErrorException in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php:21 #7 Whoops\Run:handleError in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php:21 #6 Ayctor\Controllers\BuildingController:show in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php:20 #5 call_user_func in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php:20 #4 WpCore\Bootstrap\Router:call_function in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php:74 #3 WpCore\Bootstrap\Router:is_singular in /var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/index.php:11 #2 include in /var/www/faubourg-promotion/www/wp-includes/template-loader.php:106 #1 require_once in /var/www/faubourg-promotion/www/wp-blog-header.php:19 #0 require in /var/www/faubourg-promotion/www/index.php:17
Stack frames (9)
8
Whoops\Exception\ErrorException
/app/Controllers/BuildingController.php21
7
Whoops\Run handleError
/app/Controllers/BuildingController.php21
6
Ayctor\Controllers\BuildingController show
/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php20
5
call_user_func
/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php20
4
WpCore\Bootstrap\Router call_function
/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php74
3
WpCore\Bootstrap\Router is_singular
/index.php11
2
include
/var/www/faubourg-promotion/www/wp-includes/template-loader.php106
1
require_once
/var/www/faubourg-promotion/www/wp-blog-header.php19
0
require
/var/www/faubourg-promotion/www/index.php17
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php
 
namespace Ayctor\Controllers;
 
use Ayctor\Utils\Helper;
use Ayctor\Utils\Search;
use WpCore\Controllers\Controller;
 
class BuildingController extends Controller
{
    /**
     * View for amenageur.php.
     *
     * @return string
     */
    public function show()
    {
        $layouts = get_field('building_blocks');
 
        $typologies = Helper::getTypologies(get_the_ID());
        $typology = $typologies[0];
        if (count($typologies) > 1) {
            $color = config('typologies.names.Multi Activité.color');
        } else {
            $color = config('typologies.names.' . $typology . '.color');
        }
 
        if(!$layouts) {
            $layouts = [];
        }
 
        foreach ($layouts as $key => $layout) {
            if ($layout['acf_fc_layout'] == 'layout_related') {
                $search = new Search([
                    'post_type' => 'building',
                    'typologies' => implode(',', $typologies),
                ], 0, 3);
                $recommended = $search->results();
                $layout['related_projects'] = [];
                foreach ($recommended as $project) {
                    $layout['related_projects'][] = $project['_source']['post_id'];
Arguments
  1. "Undefined array key 0"
    
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php
 
namespace Ayctor\Controllers;
 
use Ayctor\Utils\Helper;
use Ayctor\Utils\Search;
use WpCore\Controllers\Controller;
 
class BuildingController extends Controller
{
    /**
     * View for amenageur.php.
     *
     * @return string
     */
    public function show()
    {
        $layouts = get_field('building_blocks');
 
        $typologies = Helper::getTypologies(get_the_ID());
        $typology = $typologies[0];
        if (count($typologies) > 1) {
            $color = config('typologies.names.Multi Activité.color');
        } else {
            $color = config('typologies.names.' . $typology . '.color');
        }
 
        if(!$layouts) {
            $layouts = [];
        }
 
        foreach ($layouts as $key => $layout) {
            if ($layout['acf_fc_layout'] == 'layout_related') {
                $search = new Search([
                    'post_type' => 'building',
                    'typologies' => implode(',', $typologies),
                ], 0, 3);
                $recommended = $search->results();
                $layout['related_projects'] = [];
                foreach ($recommended as $project) {
                    $layout['related_projects'][] = $project['_source']['post_id'];
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
<?php
 
namespace WpCore\Bootstrap;
use Illuminate\Support\Str;
 
/**
 * Router class for WP Core boilerplate.
 * @package WpCore\Bootstrap
 */
 
class Router
{
    /**
     * Creates a list populated by the callback's controller and method.
     * Calls the function in the list passed as a parameter.
     * @param $method
     */
    protected static function call_function($callback) {
        list($controller, $method) = Str::parseCallback($callback);
        call_user_func([new $controller, $method]);
        exit();
    }
 
    /**
     * Checks if the query has no results (404).
     * @param $method
     */
    public static function is_404($method) {
        if (function_exists("is_404") && is_404()) {
            self::call_function($method);
        }
    }
 
    /**
     * Checks if you are on the BLOG homepage, if you set a static page as the front page this conditional tag
     * will return true only if you are on the page you set as the "Posts page".
     * @param $method
     */
    public static function is_home($method) {
        if (function_exists("is_home") && is_home()) {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
<?php
 
namespace WpCore\Bootstrap;
use Illuminate\Support\Str;
 
/**
 * Router class for WP Core boilerplate.
 * @package WpCore\Bootstrap
 */
 
class Router
{
    /**
     * Creates a list populated by the callback's controller and method.
     * Calls the function in the list passed as a parameter.
     * @param $method
     */
    protected static function call_function($callback) {
        list($controller, $method) = Str::parseCallback($callback);
        call_user_func([new $controller, $method]);
        exit();
    }
 
    /**
     * Checks if the query has no results (404).
     * @param $method
     */
    public static function is_404($method) {
        if (function_exists("is_404") && is_404()) {
            self::call_function($method);
        }
    }
 
    /**
     * Checks if you are on the BLOG homepage, if you set a static page as the front page this conditional tag
     * will return true only if you are on the page you set as the "Posts page".
     * @param $method
     */
    public static function is_home($method) {
        if (function_exists("is_home") && is_home()) {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
 
    /**
     * Checks if the query is for an existing single PAGE.
     * @param $page
     * @param $method
     */
    public static function is_page($method, $page = '') {
        if (function_exists("is_page") && is_page($page)) {
            self::call_function($method);
        }
    }
 
    /**
     * Checks if the query is for an existing single POST of any of the given types.
     * @param $method
     * @param string $post_type
     */
    public static function is_singular($method, $post_type = '') {
        if(function_exists("is_singular") && is_singular($post_type)) {
            self::call_function($method);
        }
    }
 
    /**
     * Checks if the query is for an existing single POST.
     * @param $method
     * @param string $post
     */
    public static function is_single($method, $post = '') {
        if(function_exists("is_single") && is_single($post)) {
            self::call_function($method);
        }
    }
 
    /**
     * Checks if the query is for an existing post type archive page.
     * @param $method
     * @param string $post_type
     */
    public static function is_post_type_archive($method, $post_type = '') {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/index.php
<?php
 
use WpCore\Bootstrap\Router;
 
Router::is_404('\Ayctor\Controllers\PageController@notFound');
Router::is_home('\Ayctor\Controllers\PageController@index');
Router::is_page('\Ayctor\Controllers\PageController@planSite', 'plan-du-site');
Router::is_page('\Ayctor\Controllers\PageController@references', 'references');
Router::is_page('\Ayctor\Controllers\PageController@page');
Router::is_singular('\Ayctor\Controllers\ProjectController@show', 'project');
Router::is_singular('\Ayctor\Controllers\BuildingController@show', 'building');
Router::is_singular('\Ayctor\Controllers\PageController@post', 'post');
 
Router::default('\Ayctor\Controllers\PageController@default');
 
/var/www/faubourg-promotion/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. "/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/index.php"
    
/var/www/faubourg-promotion/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. "/var/www/faubourg-promotion/www/wp-includes/template-loader.php"
    
/var/www/faubourg-promotion/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. "/var/www/faubourg-promotion/www/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache"
REQUEST_URI
"/references/batiment/la-farlede/parc-agroalimentaire-de-la-farlede-bat-b/bigard-distribution/"
USER
"faubpromouser"
HOME
"/home/faubpromouser"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/2.0"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/references/batiment/la-farlede/parc-agroalimentaire-de-la-farlede-bat-b/bigard-distribution/"
REMOTE_PORT
"20412"
SCRIPT_FILENAME
"//var/www/faubourg-promotion/www/index.php"
SERVER_ADMIN
"[no address given]"
CONTEXT_DOCUMENT_ROOT
"/var/www/faubourg-promotion/www"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/var/www/faubourg-promotion/www"
REMOTE_ADDR
"3.136.22.184"
SERVER_PORT
"443"
SERVER_ADDR
"91.134.217.98"
SERVER_NAME
"www.faubourg-promotion.com"
SERVER_SIGNATURE
""
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
HTTP_HOST
"www.faubourg-promotion.com"
HTTP_REFERER
"https://faubourg-promotion.com/references/batiment/la-farlede/parc-agroalimentaire-de-la-farlede-bat-b/bigard-distribution"
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
"*/*"
proxy-nokeepalive
"1"
SSL_TLS_SNI
"www.faubourg-promotion.com"
HTTPS
"on"
H2_STREAM_TAG
"1482439-1059-1"
H2_STREAM_ID
"1"
H2_PUSHED_ON
""
H2_PUSHED
""
H2_PUSH
"off"
H2PUSH
"off"
HTTP2
"on"
HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
REDIRECT_SSL_TLS_SNI
"www.faubourg-promotion.com"
REDIRECT_HTTPS
"on"
REDIRECT_H2_STREAM_TAG
"1482439-1059-1"
REDIRECT_H2_STREAM_ID
"1"
REDIRECT_H2_PUSHED_ON
""
REDIRECT_H2_PUSHED
""
REDIRECT_H2_PUSH
"off"
REDIRECT_H2PUSH
"off"
REDIRECT_HTTP2
"on"
REDIRECT_HTTP_AUTHORIZATION
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1732184200.624
REQUEST_TIME
1732184200
WP_ENV
"local"
MAIL_HOST
"in.mailjet.com"
MAIL_PORT
"587"
MAIL_USERNAME
"2fe8e3059a5051b4a4442d2337023737"
MAIL_PASSWORD
"45104832f18bfb69edcd834fe727276f"
MAIL_FROM_ADDRESS
"noreply@faubourg-promotion.com"
MAIL_FROM_NAME
"Faubourg Promotion"
MIX_APP_URL
"https://www.faubourg-promotion.com"
MAP_API_KEY
"AIzaSyC6crnPFGq4NrDgNyPmQPbXyILIEEyk47s"
GA_UA
"UA-33001738-7"
ACF_LITE
"true"
TWITTER_TOKEN
"714909892-WwFy7lVFssVUEoWTlLbkQCrSAc7CSqHiOir2x11B"
TWITTER_TOKEN_SECRET
"ffrih4y2my1pQZlgPUbVaAo9tQx81BFigs2UsW8AIFqfO"
TWITTER_CONSUMER_KEY
"Btd2Wicr1eQfccOMnP6twXZ4R"
TWITTER_CONSUMER_SECRET
"TJTLRq5lCNs4geXYqgY2doWheuXfvclIe2eq192m9PVpuAqjge"
FORM_CONTACT
"1"
FORM_PROJECT
"2"
FORM_NEWSLETTER
"3"
FORM_NEWSLETTER_FOOTER
"4"
Key Value
WP_ENV
"local"
MAIL_HOST
"in.mailjet.com"
MAIL_PORT
"587"
MAIL_USERNAME
"2fe8e3059a5051b4a4442d2337023737"
MAIL_PASSWORD
"45104832f18bfb69edcd834fe727276f"
MAIL_FROM_ADDRESS
"noreply@faubourg-promotion.com"
MAIL_FROM_NAME
"Faubourg Promotion"
MIX_APP_URL
"https://www.faubourg-promotion.com"
MAP_API_KEY
"AIzaSyC6crnPFGq4NrDgNyPmQPbXyILIEEyk47s"
GA_UA
"UA-33001738-7"
ACF_LITE
"true"
TWITTER_TOKEN
"714909892-WwFy7lVFssVUEoWTlLbkQCrSAc7CSqHiOir2x11B"
TWITTER_TOKEN_SECRET
"ffrih4y2my1pQZlgPUbVaAo9tQx81BFigs2UsW8AIFqfO"
TWITTER_CONSUMER_KEY
"Btd2Wicr1eQfccOMnP6twXZ4R"
TWITTER_CONSUMER_SECRET
"TJTLRq5lCNs4geXYqgY2doWheuXfvclIe2eq192m9PVpuAqjge"
FORM_CONTACT
"1"
FORM_PROJECT
"2"
FORM_NEWSLETTER
"3"
FORM_NEWSLETTER_FOOTER
"4"
0. Whoops\Handler\PrettyPageHandler