Whoops \ Exception \ ErrorException (E_WARNING)
Undefined property: WP_Post_Type::$term_id Whoops\Exception\ErrorException thrown with message "Undefined property: WP_Post_Type::$term_id" Stacktrace: #7 Whoops\Exception\ErrorException in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php:22 #6 Whoops\Run:handleError in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php:22 #5 THEME\ViewModel\Archive\Templates\Archive:getTermData in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive.php:83 #4 THEME\ViewModel\Archive:setTerm in /data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive.php:41 #3 THEME\ViewModel\Archive:__construct in /data/websites/telefonino/web/app/themes/telefonino/archive.php:8 #2 include in /data/websites/telefonino/web/wp/wp-includes/template-loader.php:106 #1 require_once in /data/websites/telefonino/web/wp/wp-blog-header.php:19 #0 require in /data/websites/telefonino/web/index.php:6
Stack frames (8)
7
Whoops\Exception\ErrorException
/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php:22
6
Whoops\Run handleError
/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php:22
5
THEME\ViewModel\Archive\Templates\Archive getTermData
/web/app/themes/telefonino/src/ViewModel/Archive.php:83
4
THEME\ViewModel\Archive setTerm
/web/app/themes/telefonino/src/ViewModel/Archive.php:41
3
THEME\ViewModel\Archive __construct
/web/app/themes/telefonino/archive.php:8
2
include
/web/wp/wp-includes/template-loader.php:106
1
require_once
/web/wp/wp-blog-header.php:19
0
require
/web/index.php:6
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php
namespace THEME\ViewModel\Archive\Templates;

/**
 * Pay attention this is the representation
 * of a Term into an Archive contex\t
 * 
 */
class Archive implements iTemplate {
    
    /**
     * ritorna il sottoinsieme di dati necessario per il termine
     *
     * @param object $term
     * @return array
     */
    public function getTermData( $term ) {

        return [
            
            'id'       => $term->term_id,
            'taxonomy' => $term->taxonomy,
            'title'    => $term->name,
            'excerpt'  => $term->description,
            'link'     => get_term_link( $term , $term->taxonomy ),
            'parent'   => $term->parent,
            'meta'     => $this->getCustomFields( $term ),
        ];            
    }
   

    
    /**
     * Returns acf custom fields for the given term     
     * 
     * @param WP_Term $term
     * @return array
     */
    protected function getCustomFields( $term ) {

        $fieldsRetrieved = [];
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive/Templates/Archive.php
namespace THEME\ViewModel\Archive\Templates;

/**
 * Pay attention this is the representation
 * of a Term into an Archive contex\t
 * 
 */
class Archive implements iTemplate {
    
    /**
     * ritorna il sottoinsieme di dati necessario per il termine
     *
     * @param object $term
     * @return array
     */
    public function getTermData( $term ) {

        return [
            
            'id'       => $term->term_id,
            'taxonomy' => $term->taxonomy,
            'title'    => $term->name,
            'excerpt'  => $term->description,
            'link'     => get_term_link( $term , $term->taxonomy ),
            'parent'   => $term->parent,
            'meta'     => $this->getCustomFields( $term ),
        ];            
    }
   

    
    /**
     * Returns acf custom fields for the given term     
     * 
     * @param WP_Term $term
     * @return array
     */
    protected function getCustomFields( $term ) {

        $fieldsRetrieved = [];
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive.php

    /**
     * Add the data of the current term or post type or author
     *
     * @return void
     */
    protected function setTerm( $object_type = 'WP_Term' ) {

        switch( $object_type ){

            case 'WP_Term':      $term = $this->term; break;
            case 'WP_Post_Type': $term = $this->post_type; break;
            case 'WP_User':      $term = $this->author; break;

            /// home page
            default: $term =  null; 
        }
        

        $this->data['term'] = empty( $term ) ? [] : $this->archiveTemplate->getTermData( $term );
    }


    /**
     * set the posts list as articles array using 
     * the standard wp_query 
     * 
     * AND SET the total pages to data ( lo so qui bisognerebbe architettarlo un mo meglio)
     *      
     * @return void
     */
    protected function setArticles() {

        // create the query for main contents
        $args = [            
            'paged'          => $this->paged,            
            'post_type'      => empty( $this->post_type) ? 'notizie' : $this->post_type->name,
        ];

        if( !empty( $this->term ) ) {
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Archive.php
    function __construct( $postTemplate = 'Archive', $archiveTemplate = 'Archive' ) {

        $queried_object = get_queried_object();

        $obj_type = empty( $queried_object ) ? '' : get_class( $queried_object ) ; 

        $this->term      = ( $obj_type ==  'WP_Term'      ) ? $queried_object : null;
        $this->post_type = ( $obj_type ==  'WP_Post_Type' ) ? $queried_object : null;
        $this->author    = ( $obj_type ==  'WP_User'      ) ? $queried_object : null;

        parent::__construct();

        // set the postTemplate (default 'Archive')      
        $this->postTemplate    = $this->postTemplateFactory( $postTemplate );

        // set the archiveTemplate (default 'Archive') 
        $this->archiveTemplate = $this->archiveTemplateFactory( $archiveTemplate );

        // add the current term's data
        $this->setTerm( $obj_type );

        // add the articles to data
        $this->setArticles();

        // set the components list into property
        // $components
        $this->initComponents();

        // add all the default components
        $this->setComponents();
    }


    /**
     * Writes the basic page informations
     */
    protected function setPageData(){       
        $this->data = [
            'type' => 'archive',
            'infinite' => 'true',
/data/websites/telefonino/web/app/themes/telefonino/archive.php
<?php

use THEME\ViewModel\Archive;
use THEME\Utils\Timber;

$paged = (get_query_var('paged') && get_query_var('paged') !== 0) ? get_query_var('paged') : 1;  

$data = ( new Archive() ) ->getData();

$data['page'] = $paged;

$template = $paged == 1 ? 'archive.twig' : 'archive-paged.twig';

Timber::render( $template, $data );

 
/data/websites/telefonino/web/wp/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;
}
 
/data/websites/telefonino/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';
 
}
 
/data/websites/telefonino/web/index.php
<?php
/**
 * WordPress View Bootstrapper
 */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.26.2
REQUEST_URI /notizie/
USER nginx
HOME /var/lib/nginx
HTTP_REFERER https://staging.telefonino.net/notizie
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_CONNECTION close
HTTP_X_FORWARDED_FOR 216.73.216.49
HTTP_HOST staging.telefonino.net
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
REDIRECT_STATUS 200
SERVER_NAME staging.telefonino.net
SERVER_PORT 443
SERVER_ADDR 10.50.50.197
REMOTE_PORT 58300
REMOTE_ADDR 10.50.50.12
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.0
DOCUMENT_ROOT /data/websites/telefonino/web
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/websites/telefonino/web/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1774554689.8323
REQUEST_TIME 1774554689
DB_NAME telefonino
DB_USER telefoninoUSR
DB_PASSWORD .T3lefon!n0.
DB_HOST localhost
DB_PREFIX wp_
GTM_ID GTM-PV4S3R4X
ASSETS_DIR /app/themes/telefonino/assets
FORMINATOR_NEWSLETTER_FORM_ID 404256
WP_ENV staging
WP_HOME https://staging.telefonino.net
WP_SITEURL https://staging.telefonino.net/wp
WP_THEMEPATH https://staging.telefonino.net/app/themes/telefonino/
WP_EMAIL no-reply@telefonino.net
WP_DEBUG true
WP_CACHE false
DISABLE_WP_CRON true
WP_MEMORY_LIMIT 512M
WP_POST_REVISIONS false
AUTH_KEY &uq&p$ypr;Yr7DiuR3ECXHD14o0M562d|MYpdP>;X.fm9q@pOvJ^D-/w9uC+`q1z
SECURE_AUTH_KEY *kkFy7N_9]uNEIk%lG{zxv|aT/_BSV:-|l+C{NU|2/|-HJqP82K[e7mg=>qX!Mef
LOGGED_IN_KEY RJ%0[1(1^$bKjvj^IXV!e[%+yD;d1_fl/)Q4/SdSO>>np:+=`+Es9UbS]dOg89J=
NONCE_KEY 1RTq(</}tixMOUC^n44?.,xA!,n-ms-6J@,LS@/aVJAk8<Ofvjaeu[1iPzU,oG{q
AUTH_SALT ,ptA@)1JrYHO3CjZxYcqX_v<7@X1>2*v7K<Ul2?ofl2qP<>!qzjkf)$Zu&iovz-k
SECURE_AUTH_SALT GA/axYdH9ls=wCH#1XwF9P&E<jOP^d4VKlFF?>vb4Czz3v$jz0dl@DES]&A3D_`^
LOGGED_IN_SALT tWjy]Qb,XQ9%th/9Oi1D;E/L@z-Oo5<TfTSVD-obR;MTyal!SWCcez=fnAGNFlFL
NONCE_SALT aMNhCOYLU+(1URHOor&2^Ux0}9%5eQ1B;MRZ({=XMcw!+42NI3Gx?;,L&Y;yYni]
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
Key Value
DB_NAME telefonino
DB_USER telefoninoUSR
DB_PASSWORD .T3lefon!n0.
DB_HOST localhost
DB_PREFIX wp_
GTM_ID GTM-PV4S3R4X
ASSETS_DIR /app/themes/telefonino/assets
FORMINATOR_NEWSLETTER_FORM_ID 404256
WP_ENV staging
WP_HOME https://staging.telefonino.net
WP_SITEURL https://staging.telefonino.net/wp
WP_THEMEPATH https://staging.telefonino.net/app/themes/telefonino/
WP_EMAIL no-reply@telefonino.net
WP_DEBUG true
WP_CACHE false
DISABLE_WP_CRON true
WP_MEMORY_LIMIT 512M
WP_POST_REVISIONS false
AUTH_KEY &uq&p$ypr;Yr7DiuR3ECXHD14o0M562d|MYpdP>;X.fm9q@pOvJ^D-/w9uC+`q1z
SECURE_AUTH_KEY *kkFy7N_9]uNEIk%lG{zxv|aT/_BSV:-|l+C{NU|2/|-HJqP82K[e7mg=>qX!Mef
LOGGED_IN_KEY RJ%0[1(1^$bKjvj^IXV!e[%+yD;d1_fl/)Q4/SdSO>>np:+=`+Es9UbS]dOg89J=
NONCE_KEY 1RTq(</}tixMOUC^n44?.,xA!,n-ms-6J@,LS@/aVJAk8<Ofvjaeu[1iPzU,oG{q
AUTH_SALT ,ptA@)1JrYHO3CjZxYcqX_v<7@X1>2*v7K<Ul2?ofl2qP<>!qzjkf)$Zu&iovz-k
SECURE_AUTH_SALT GA/axYdH9ls=wCH#1XwF9P&E<jOP^d4VKlFF?>vb4Czz3v$jz0dl@DES]&A3D_`^
LOGGED_IN_SALT tWjy]Qb,XQ9%th/9Oi1D;E/L@z-Oo5<TfTSVD-obR;MTyal!SWCcez=fnAGNFlFL
NONCE_SALT aMNhCOYLU+(1URHOor&2^Ux0}9%5eQ1B;MRZ({=XMcw!+42NI3Gx?;,L&Y;yYni]
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
0. Whoops\Handler\PrettyPageHandler