Whoops \ Exception \ ErrorException (E_NOTICE)
Trying to get property 'type' of non-object Whoops\Exception\ErrorException thrown with message "Trying to get property 'type' of non-object" Stacktrace: #13 Whoops\Exception\ErrorException in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/boutique/BoutiqueOrderProcessor.php:21 #12 Whoops\Run:handleError in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/boutique/BoutiqueOrderProcessor.php:21 #11 Syltaen\BoutiqueOrderProcessor:process in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/ContentsProcessor.php:372 #10 Syltaen\ContentsProcessor:boutique_order in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/ContentsProcessor.php:453 #9 Syltaen\ContentsProcessor:process in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/lib/Controllers/DataProcessor.php:60 #8 Syltaen\DataProcessor:processEach in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/SectionsProcessor.php:17 #7 Syltaen\SectionsProcessor:process in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/lib/Controllers/DataProcessor.php:60 #6 Syltaen\DataProcessor:processEach in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/PageController.php:24 #5 Syltaen\PageController:__construct in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/Helpers/Route.php:38 #4 Syltaen\Route:respond in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/Helpers/Route.php:161 #3 Syltaen\Route:is in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/index.php:57 #2 include in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-includes/template-loader.php:106 #1 require_once in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-blog-header.php:19 #0 require in /var/www/vhosts/bewapp.hungryminds.host/httpdocs/index.php:17
Stack frames (14)
13
Whoops\Exception\ErrorException
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/boutique/BoutiqueOrderProcessor.php21
12
Whoops\Run handleError
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/boutique/BoutiqueOrderProcessor.php21
11
Syltaen\BoutiqueOrderProcessor process
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/ContentsProcessor.php372
10
Syltaen\ContentsProcessor boutique_order
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/ContentsProcessor.php453
9
Syltaen\ContentsProcessor process
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/lib/Controllers/DataProcessor.php60
8
Syltaen\DataProcessor processEach
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/processors/SectionsProcessor.php17
7
Syltaen\SectionsProcessor process
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/lib/Controllers/DataProcessor.php60
6
Syltaen\DataProcessor processEach
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/Controllers/PageController.php24
5
Syltaen\PageController __construct
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/Helpers/Route.php38
4
Syltaen\Route respond
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/app/Helpers/Route.php161
3
Syltaen\Route is
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/index.php57
2
include
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-includes/template-loader.php106
1
require_once
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-blog-header.php19
0
require
/var/www/vhosts/bewapp.hungryminds.host/httpdocs/index.php17
 
namespace Syltaen;
 
class BoutiqueOrderProcessor extends DataProcessor
{
 
    /**
     * Process the content
     *
     * @param [type] $content
     * @return void
     */
    public function process($data)
    {
        $this->data = $data;
 
        $this->userData = $this->controller->user->loadEverything()->loadBoutique()->getOne();
        $this->cart = new Cart();
 
        $this->data["show_ecole_pp_check"] = $this->userData->type == "ecole";
 
        // Act based on the recieved data
        if (!empty($_POST)) {
            $this->post($_POST);
        } else {
            $this->get();
        }
 
        return $this->data;
    }
 
 
    // ==================================================
    // > GET
    // ==================================================
    /**
     * Context for the rendering
     *
     * @return void
     */
Arguments
  1. "Trying to get property 'type' of non-object"
    
 
namespace Syltaen;
 
class BoutiqueOrderProcessor extends DataProcessor
{
 
    /**
     * Process the content
     *
     * @param [type] $content
     * @return void
     */
    public function process($data)
    {
        $this->data = $data;
 
        $this->userData = $this->controller->user->loadEverything()->loadBoutique()->getOne();
        $this->cart = new Cart();
 
        $this->data["show_ecole_pp_check"] = $this->userData->type == "ecole";
 
        // Act based on the recieved data
        if (!empty($_POST)) {
            $this->post($_POST);
        } else {
            $this->get();
        }
 
        return $this->data;
    }
 
 
    // ==================================================
    // > GET
    // ==================================================
    /**
     * Context for the rendering
     *
     * @return void
     */
    /**
     * Handle content for the user's password reset
     *
     * @param array $c
     * @return void
     */
    private function user_password(&$c)
    {
        $c = (new UserPasswordResetProcessor($this->controller))->process($c);
    }
 
    /**
     * Handle content for the boutique orders
     *
     * @param array $c
     * @return void
     */
    private function boutique_order(&$c)
    {
        $c = (new BoutiqueOrderProcessor($this->controller))->process($c);
    }
 
    /**
     * Handle content for the boutique orders
     *
     * @param array $c
     * @return void
     */
    private function defined_order(&$c)
    {
        $c = (new BoutiqueDefinedOrderProcessor($this->controller))->process($c);
    }
 
    /**
     * Handle content for the boutique orders
     *
     * @param array $c
     * @return void
     */
    private function dashboard_challenges(&$c)
     * @return void
     */
    public function process($content)
    {
        // Run the correct mehtod by looking at the acf_fc_layout
        switch ($content["acf_fc_layout"]) {
 
            // Add custom layout-method routes here
            // Ex:
            // case "name-of-the-layout-1":
            // case "name-of-the-layout-2":
            //     static::nameOfTheMethod($content);
            //     break;
 
 
            // By default : convert - into _ and use the result as a method name
            default:
                $method = str_replace("-", "_", $content["acf_fc_layout"]);
                if (method_exists(static::class, $method)) {
                    $this->{$method}($content);
                }
        }
 
        return $content;
    }
 
    // =============================================================================
    // > DEPRECIATED
    // =============================================================================
    /**
     * Handle data for the "2 columns" content type
     *
     * @param [type] $c
     * @return void
     */
    private function txt_2col(&$c)
    {
        $c["class"]       = "align-".$c["valign"];
        $c["txt_1_class"] = "gr-".substr($c['proportions'], 0, 1);
        $c["txt_2_class"] = "gr-".substr($c['proportions'], 2, 1);
        return false;
    }
 
 
    /**
     * Process each item of an array and return the result array
     *
     * @param mixed $item
     * @return mixed
     */
    public function processEach($raw)
    {
        $proccessed = [];
 
        if (empty($raw)) return [];
 
        foreach ((array) $raw as $i=>$rawItem) {
            $this->pointer = $i;
 
            $item = $this->process($rawItem);
 
            // Only include the result if it is valid
            if ($item) {
                $proccessed[] = $item;
            }
        }
 
        return $proccessed;
    }
}
<?php
 
namespace Syltaen;
 
class SectionsProcessor extends DataProcessor
{
    /**
     * Processing of each section
     */
    public function process($section)
    {
        if ($this->shouldHide($section)) return false;
 
        $this->addAttributes($section);
        $this->addClasses($section);
 
        $section["content"] = (new ContentsProcessor($this->controller))->processEach($section["content"]);
 
        return $section;
    }
 
 
    /**
     * Process a section's parameters
     *
     * @param array $s The section data
     * @return void
     */
    private function addClasses(&$s)
    {
        $s["classes"] = ["site-section"];
 
        // ========== PADDING ========== //
        if ($s["padding_top"] != "no") $s["classes"][] = $s["padding_top"] . "-padding-top";
        if ($s["padding_bottom"] != "no") $s["classes"][] = $s["padding_bottom"] . "-padding-bottom";
 
        if ($s["padding_top_sm"] != "unset") $s["classes"][] = $s["padding_top_sm"] . "-padding-top-sm";
        if ($s["padding_bottom_sm"] != "unset") $s["classes"][] = $s["padding_bottom_sm"] . "-padding-bottom-sm";
 
        if ($s["padding_top_xs"] != "unset") $s["classes"][] = $s["padding_top_xs"] . "-padding-top-xs";
        return false;
    }
 
 
    /**
     * Process each item of an array and return the result array
     *
     * @param mixed $item
     * @return mixed
     */
    public function processEach($raw)
    {
        $proccessed = [];
 
        if (empty($raw)) return [];
 
        foreach ((array) $raw as $i=>$rawItem) {
            $this->pointer = $i;
 
            $item = $this->process($rawItem);
 
            // Only include the result if it is valid
            if ($item) {
                $proccessed[] = $item;
            }
        }
 
        return $proccessed;
    }
}
class PageController extends BaseController
{
    /**
     * Populate $this->data
     *
     * @param bool $spacial_page
     */
    public function __construct($args = [])
    {
        parent::__construct($args);
 
        $this->addData([
            // intro
            "intro_content" => "",
            "intro_bg",
            "intro_grad" => false,
            "(img:url) intro_badge",
 
            // content
            "@sections" => (new SectionsProcessor($this))->processEach(Data::get("sections")),
 
            // permissions
            "login_required",
            "login_required_redirect",
            "role_required",
            "role_required_list",
            "role_required_redirect"
        ]);
 
        // Permissions check
        $this->redirectNotAllowed();
 
        // Bare content template
        if (Data::get("bare-content")) $this->setupBareContent();
    }
 
 
 
    /**
     * Setup data to be used in a bare-contnet template
        // Clear obsolete flash data
        if (!$same_session_page) {
            Data::goToNextSessionPage();
        }
 
        // Class method call
        if (is_string($resp)) {
 
            // Extracts method
            $method = false;
            if (preg_match('/(.*)::(.*)/', $resp, $keys)) {
                $resp = $keys[1];
                $method = $keys[2];
            }
 
            // Add namespace to class
            $classname = "Syltaen\\$resp";
 
            // Instanciate the class with the arguments
            $class = new $classname($args);
 
            // Lauch mehtod if any
            if ($method) {
                $class->$method();
            }
        }
 
        // Closure function call
        if (is_callable($resp)) {
            $resp($args);
        }
 
        exit;
    }
 
    // ==================================================
    // > RULES
    // ==================================================
    public static function any($resp, $args = [])
    {
     * @param boolean $resp
     * @param array $args
     * @return boolean
     */
    public static function is($condition, $resp = false, $args = null, $prefix = "is_")
    {
        $conditions = (array) $condition;
 
        foreach ($conditions as $condition) {
            $argument = null;
 
            if (preg_match('/(.*):(.*)/', $condition, $parts)) {
                $condition = $parts[1];
                $argument  = $parts[2];
            }
 
            $condition = $prefix . $condition;
            if ($condition($argument)) {
                if ($resp) {
                    static::respond($resp, $args);
                }
                return true;
            };
        }
        return false;
    }
 
 
    /**
     * Website is in maintenance mode
     *
     * @param boolean $resp
     * @return void
     */
    public static function maintenance($resp = false)
    {
        if (Data::get("maintenance_mode", "option") && !current_user_can("administrator")) {
            static::respond($resp);
        }
    }
// ==================================================
// > API
// ==================================================
Route::custom("api", "ApiController", ["method", "target", "mode"]);
 
// ==================================================
// > NINJA FORM PREVIEW
// ==================================================
Route::query("nf_preview_form", "SpecialPageController::ninjaFormPreview");
 
// ==================================================
// > HOMEPAGE
// ==================================================
Route::is(["home", "front_page"], "HomeController::render");
 
// ==================================================
// > PAGES
// ==================================================
Route::is("page:".DashboardController::SLUG, "DashboardController::render");
Route::is("page", "PageController::render");
 
 
// ==================================================
// > 404
// ==================================================
Route::is("404", "SpecialPageController::error404");
            }
 
            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/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/index.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/vhosts/bewapp.hungryminds.host/httpdocs/wp-includes/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';
 
Arguments
  1. "/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
Key Value
syltaen_current_page
[]
syltaen_messages
[]
Key Value
SERVER_SOFTWARE
"Apache"
REQUEST_URI
"/proprete-publique/boutique/panier/"
USER
"bewapp"
HOME
"/var/www/vhosts/bewapp.hungryminds.host"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.0"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/proprete-publique/boutique/panier/"
REMOTE_PORT
"53542"
SCRIPT_FILENAME
"/var/www/vhosts/bewapp.hungryminds.host/httpdocs/index.php"
SERVER_ADMIN
"[no address given]"
CONTEXT_DOCUMENT_ROOT
"/var/www/vhosts/bewapp.hungryminds.host/httpdocs"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/var/www/vhosts/bewapp.hungryminds.host/httpdocs"
REMOTE_ADDR
"3.238.250.73"
SERVER_PORT
"443"
SERVER_ADDR
"172.31.40.112"
SERVER_NAME
"bewapp.hungryminds.host"
SERVER_SIGNATURE
"<address>Apache Server at bewapp.hungryminds.host Port 443</address>\n"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
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_CONNECTION
"close"
HTTP_X_REAL_IP
"3.238.250.73"
HTTP_HOST
"bewapp.hungryminds.host"
proxy-nokeepalive
"1"
HTTPS
"on"
HTTP_AUTHORIZATION
""
UNIQUE_ID
"ZBuOsqwfKHAAABmUTC4AAAAL"
REDIRECT_STATUS
"200"
REDIRECT_HTTPS
"on"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_UNIQUE_ID
"ZBuOsqwfKHAAABmUTC4AAAAL"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1679527602.5232
REQUEST_TIME
1679527602
empty
0. Whoops\Handler\PrettyPageHandler