Error
Call to a member function getSubCommunityName() on null Error thrown with message "Call to a member function getSubCommunityName() on null" Stacktrace: #2 Error in /home/psinv/public_html/functions.php:3087 #1 crm_get_meta in /home/psinv/public_html/src/pages/header.php:42 #0 include in /home/psinv/public_html/index.php:1853
Stack frames (3):
2 Error
…/­functions.php3087
1 crm_get_meta
…/­src/­pages/­header.php42
0 include
…/­index.php1853
/home/psinv/public_html/functions.php
    }  elseif( 'project-units' == $_route  ) { 
        global $beds, $contract, $unit_types;
            $meta['title'] = "⚡ ".__(ucwords(str_replace( '-', ' ', $unit_types )),'realia');

            $titleLength = strlen($meta['title']);
            if($titleLength < 40){$meta['title'] .= ' - '.__('Property Shop Investment','realia');}
            elseif($titleLength >= 40 && $titleLength <= 51){$meta['title'] .= ' - '.__('PSI Abu dhabi','realia');}          
            else{$meta['title'] .= ' - '.__('PSI','realia');} 

            $meta['description'] =   "⚡ ".ucwords( str_replace('-', " ", $unit_types) ) . ' - '. __($projectObj->getSubCommunityName(),'realia'). ' , ' . __($projectObj->getCommunityName(),'realia'). ' ' . __('PSI','realia');
    }  elseif( 'project-links' == $_route  ) { 
        global $links;
        $meta['title'] = "⚡ ". __($projectObj->getName(),'realia') . ' - '.__("Properties","realia") . ", " . __($projectObj->getCommunityName(),'realia');  
        $meta['description'] =   "⚡ ".__("Explore our properties and experience the ultimate comfort, style and convenience at","realia") .' '. __($projectObj->getName(),'realia'). ", " . __($projectObj->getSubCommunityName(),'realia'). " " . __($projectObj->getCommunityName(),'realia'). " " . __($projectObj->getCityName(),'realia');
        $titleLength = strlen($meta['title']);
        $descLength = strlen($meta['description']);        
        if($titleLength < 30){$meta['title'] .= ' - '.__(' - Property Shop Investment','realia');}
        if($descLength < 125){$meta['description'] .= ' - '.__('Property Shop Investment','realia');}        
    }  elseif( 'unit-type-type-community-page' == $_route  ) { 
        global $new_types,$titlename,$finaltypewor,$community_name,$city_name,$finalcontract,$slug,$iscontract;
/home/psinv/public_html/src/pages/header.php
<!DOCTYPE html>
<html lang="en-US">
    <head>
    <meta name="facebook-domain-verification" content="ezmak3v00vwq5o11bvf5siduu44wgs" />
    <meta charset="utf-8">
    <link rel="canonical" href="<?php echo crm_get_canonical_url(); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-control" content="public">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    <?php $meta = crm_get_meta( $_route ); ?>
    <title><?php echo $meta['title']; ?></title>
    <meta name="description" content="<?php echo $meta['description']; ?>">
    <meta name="author" content="<?php echo $meta['author']; ?>">
    <meta name="keywords" content="<?php echo $meta['keywords']; ?>">
    <meta property="og:title" content=" <?php echo $meta['title']; ?>" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="<?php echo crm_get_canonical_url(); ?>" />
    <meta property="og:description" content=" <?php echo $meta['description']; ?>" />
    <meta property="og:image:type" content="image/jpeg" />
    <?php echo allowindex($_route);?>
/home/psinv/public_html/index.php
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer-search-test.php';
        }
        elseif ($_route == 'international'|| $_route == 'test' || $_route =='international-test2'){
            if(!$hidehtml) include __DIR__.'/src/pages/header-international.php'; 
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer-content-international.php';
        }
        else { 
            if(!$hidehtml) include __DIR__.'/src/pages/header.php'; 
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer.php';
        }

    } elseif( $amp ) {
        include __DIR__.'/src/amp-pages/header.php'; 
        include sprintf(__DIR__.'/src/amp-pages/%s.php', $_route);
        include __DIR__.'/src/amp-pages/footer.php';
    }
     

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /en/projects/abu-dhabi/saadiyat-island/saadiyat-beach-villas/saadiyat-beach-villassaadiyat-beach-villas/type/villa-for-sale-in-saadiyat-beach-villas/
CONTEXT_DOCUMENT_ROOT /home/psinv/public_html
CONTEXT_PREFIX
DOCUMENT_ROOT /home/psinv/public_html
GATEWAY_INTERFACE CGI/1.1
H2PUSH off
H2_PUSH off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID 1
H2_STREAM_TAG 27527-1725-1
HTTP2 on
HTTPS on
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, br
HTTP_AUTHORIZATION
HTTP_CDN_LOOP cloudflare
HTTP_CF_CONNECTING_IP 3.238.62.119
HTTP_CF_IPCOUNTRY US
HTTP_CF_RAY 86bc727cb9945a0f-IAD
HTTP_CF_VISITOR {\"scheme\":\"https\"}
HTTP_HOST psinv.net
HTTP_REFERER https://psinv.net/en/projects/abu-dhabi/saadiyat-islandsaadiyat-beach-villas/saadiyat-beach-villas/type/villa-for-sale-in-saadiyat-beach-villas/
HTTP_USER_AGENT claudebot
HTTP_X_FORWARDED_FOR 3.238.62.119
HTTP_X_FORWARDED_PROTO https
PATH /bin:/usr/bin
PHP_INI_SCAN_DIR /opt/cpanel/ea-php73/root/etc:/opt/cpanel/ea-php73/root/etc/php.d:.
QUERY_STRING
REDIRECT_H2PUSH off
REDIRECT_H2_PUSH off
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID 1
REDIRECT_H2_STREAM_TAG 27527-1725-1
REDIRECT_HTTP2 on
REDIRECT_HTTPS on
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_SSL_TLS_SNI psinv.net
REDIRECT_STATUS 200
REDIRECT_UNIQUE_ID ZgYoHAJEb2eQL6PgR98xLwAAihA
REDIRECT_URL /en/projects/abu-dhabi/saadiyat-island/saadiyat-beach-villas/saadiyat-beach-villassaadiyat-beach-villas/type/villa-for-sale-in-saadiyat-beach-villas/
REMOTE_ADDR 172.70.35.87
REMOTE_PORT 55142
REQUEST_METHOD GET
REQUEST_SCHEME https
SCRIPT_FILENAME /home/psinv/public_html/index.php
SCRIPT_NAME /index.php
SERVER_ADDR 162.214.200.92
SERVER_ADMIN [email protected]
SERVER_NAME psinv.net
SERVER_PORT 443
SERVER_PROTOCOL HTTP/2.0
SERVER_SIGNATURE
SSL_TLS_SNI psinv.net
TZ Asia/Dubai
UNIQUE_ID ZgYoHAJEb2eQL6PgR98xLwAAihA
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711679516.2138
REQUEST_TIME 1711679516
argv Array ( )
argc 0
empty
0. Whoops\Handler\PrettyPageHandler