Whoops \ Exception \ ErrorException (E_ERROR)
Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php:446 Stack trace: #0 /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php(446): array_merge() #1 /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleVersionController.php(37): SingleController->gallery() #2 /data/websites/newstreet/web/app/themes/newstreet/single-auto.php(12): SingleVersionController->__construct() #3 /data/websites/newstreet/web/wp/wp-includes/template-loader.php(106): include('...') #4 /data/websites/newstreet/web/wp/wp-blog-header.php(19): require_once('...') #5 /data/websites/newstreet/web/index.php(6): require('...') #6 {main} thrown Whoops\Exception\ErrorException thrown with message "Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php:446 Stack trace: #0 /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php(446): array_merge() #1 /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleVersionController.php(37): SingleController->gallery() #2 /data/websites/newstreet/web/app/themes/newstreet/single-auto.php(12): SingleVersionController->__construct() #3 /data/websites/newstreet/web/wp/wp-includes/template-loader.php(106): include('...') #4 /data/websites/newstreet/web/wp/wp-blog-header.php(19): require_once('...') #5 /data/websites/newstreet/web/index.php(6): require('...') #6 {main} thrown" Stacktrace: #2 Whoops\Exception\ErrorException in /data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php:446 #1 Whoops\Run:handleError in /data/websites/newstreet/vendor/filp/whoops/src/Whoops/Run.php:486 #0 Whoops\Run:handleShutdown in [internal]:0
Stack frames (3)
2
Whoops\Exception\ErrorException
/web/app/themes/newstreet/controllers/SingleController.php446
1
Whoops\Run handleError
/vendor/filp/whoops/src/Whoops/Run.php486
0
Whoops\Run handleShutdown
[internal]0
/data/websites/newstreet/web/app/themes/newstreet/controllers/SingleController.php
        if (!empty($this->model_images)){
            if(isset($this->model_images['motore'])){
                $this->data['img_motore'] = $this->getRandomImages($this->model_images['motore'], 1)[0];
                $this->data['img_motore_label'] = 'Foto del motore di ';
            }
            // partitionate the ids 
            switch(($post_id % 4)){
                // for the 25% of the ids print only the "esterni" imgs
                case 0 : 
                    $this->data['gallery_widget'] = $this->getRandomImages($this->model_images['esterni'], 4);
                    $this->data['gallery_widget_label'] = 'Foto degli esterni di ';
                    break;
                // for the 25% of the ids print only the "interni" imgs
                case 1 : 
                    $this->data['gallery_widget'] = $this->getRandomImages($this->model_images['interni'], 4); 
                    $this->data['gallery_widget_label'] = 'Foto degli interni di ';
                    break; 
                case 2 : 
                case 3 :
                    $this->data['gallery_widget'] = array_merge($this->getRandomImages($this->model_images['interni'], 2), $this->getRandomImages($this->model_images['esterni'], 2)); 
                    $this->data['gallery_widget_label'] = 'Foto degli esterni e interni di ';
                    break; 
                // for the 50% of the ids print both "interni" and "esterni imgs
                default : $this->data['gallery_widget'] = null;
            }
 
            // if something goes wrong or even we are in third (50%) partition
            if($this->data['gallery_widget'] == null) {
                
                $_count_interni = count($this->model_images['interni']);
                if($_count_interni) {
                    $this->data['gallery_widget'] = array_merge(
                        $this->getRandomImages($this->model_images['interni'], $_count_interni),
                        $this->getRandomImages($this->model_images['esterni'], 4-$_count_interni)); 
                    $this->data['gallery_widget_label'] = 'Foto degli esterni e interni di ';
                } else {
                    $this->data['gallery_widget'] = $this->getRandomImages($this->model_images['esterni'], 4);
                    $this->data['gallery_widget_label'] = 'Foto degli esterni di ';
                }
            }
/data/websites/newstreet/vendor/filp/whoops/src/Whoops/Run.php
     *
     * @return void
     */
    public function handleShutdown()
    {
        // If we reached this step, we are in shutdown handler.
        // An exception thrown in a shutdown handler will not be propagated
        // to the exception handler. Pass that information along.
        $this->canThrowExceptions = false;
 
        $error = $this->system->getLastError();
        if ($error && Misc::isLevelFatal($error['type'])) {
            // If there was a fatal error,
            // it was not handled in handleError yet.
            $this->allowQuit = false;
            $this->handleError(
                $error['type'],
                $error['message'],
                $error['file'],
                $error['line']
            );
        }
    }
 
    /**
     * @param Throwable $exception
     *
     * @return Inspector
     */
    private function getInspector($exception)
    {
        return new Inspector($exception);
    }
 
    /**
     * Resolves the giving handler.
     *
     * @param callable|HandlerInterface $handler
     *
     * @return HandlerInterface
[internal]

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE nginx/1.20.0
REQUEST_URI /auto/bmw/serie-4-gran-coupe/430i-sport-auto/
USER apache
HOME /usr/share/httpd
HTTP_USER_AGENT Mozilla/5.0 (compatible; SemrushBot/7~bl; +http://www.semrush.com/bot.html)
HTTP_ACCEPT_ENCODING gzip,deflate
HTTP_ACCEPT text/html, application/rss+xml, application/atom+xml, text/xml, text/rss+xml, application/xhtml+xml
HTTP_CONNECTION close
HTTP_X_FORWARDED_FOR 185.191.171.13
HTTP_HOST www.newstreet.it
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
REDIRECT_STATUS 200
SERVER_NAME www.newstreet.it
SERVER_PORT 443
SERVER_ADDR 10.50.50.22
REMOTE_PORT 54604
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/newstreet/web
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/websites/newstreet/web/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710798836.1302
REQUEST_TIME 1710798836
DB_PREFIX wp_
DB_NAME newstreet
DB_USER newstreet_usr
DB_PASSWORD N3wstre3t_P4sw
DB_HOST mysqlns
WP_ENV production
WP_HOME https://www.newstreet.it
WP_SITEURL https://www.newstreet.it/wp
WP_THEMEPATH https://www.newstreet.it/app/themes/newstreet/
WP_EMAIL no-reply@newstreet.it
WP_CACHE false
DISABLE_WP_CRON true
AUTH_KEY vAge9cv|Wx,ODnxBBSMN[W[?oc`$ifeA+j{khb1nMnQi8El[po[,ijGND7/1lQ0+
SECURE_AUTH_KEY hXuGmxh{Pwjs`jcP1<W5;lT|8;ipm<Qh)%|8iSzk?8qu`Dp>]:=#mrJ_?Jv*KfC[
LOGGED_IN_KEY e)Rr`tm9PAQHhTQ%.0.@_;}p}9*16nfR>.HV_wKet!a7C#6a}}CVGaSH8e|$*;X@
NONCE_KEY r634U$K-bQJz4OQBn{E3g!a25e5Yk{owhiRNA#feAysAo{UJafZEloq&mD+cse%#
AUTH_SALT EFv-0/{/}f.+6P[U4pW8<z@S|@=x^,&9l3N50T):7z;Y0wd9n9gK5af!WG)cVLqX
SECURE_AUTH_SALT BE6>K(a_chP{CHEBz)^CP0R,[MXlY(E!U7[*|!}HLeu[oL,*mtCy7KcM#4_cYe<-
LOGGED_IN_SALT r_TgI#$)jU`[!p}R9bx<yW@RpH%]taJ[:3)bKKI:Zr$<R&L0?:C/(U<(cHIXr1kT
NONCE_SALT [].Yrp!.5y?}U&Nu+Z|Edv%]XuTl07bZl%%JXByW{g5,@u{WIJ-@_4h/;1G#NSA1
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
Key Value
DB_PREFIX wp_
DB_NAME newstreet
DB_USER newstreet_usr
DB_PASSWORD N3wstre3t_P4sw
DB_HOST mysqlns
WP_ENV production
WP_HOME https://www.newstreet.it
WP_SITEURL https://www.newstreet.it/wp
WP_THEMEPATH https://www.newstreet.it/app/themes/newstreet/
WP_EMAIL no-reply@newstreet.it
WP_CACHE false
DISABLE_WP_CRON true
AUTH_KEY vAge9cv|Wx,ODnxBBSMN[W[?oc`$ifeA+j{khb1nMnQi8El[po[,ijGND7/1lQ0+
SECURE_AUTH_KEY hXuGmxh{Pwjs`jcP1<W5;lT|8;ipm<Qh)%|8iSzk?8qu`Dp>]:=#mrJ_?Jv*KfC[
LOGGED_IN_KEY e)Rr`tm9PAQHhTQ%.0.@_;}p}9*16nfR>.HV_wKet!a7C#6a}}CVGaSH8e|$*;X@
NONCE_KEY r634U$K-bQJz4OQBn{E3g!a25e5Yk{owhiRNA#feAysAo{UJafZEloq&mD+cse%#
AUTH_SALT EFv-0/{/}f.+6P[U4pW8<z@S|@=x^,&9l3N50T):7z;Y0wd9n9gK5af!WG)cVLqX
SECURE_AUTH_SALT BE6>K(a_chP{CHEBz)^CP0R,[MXlY(E!U7[*|!}HLeu[oL,*mtCy7KcM#4_cYe<-
LOGGED_IN_SALT r_TgI#$)jU`[!p}R9bx<yW@RpH%]taJ[:3)bKKI:Zr$<R&L0?:C/(U<(cHIXr1kT
NONCE_SALT [].Yrp!.5y?}U&Nu+Z|Edv%]XuTl07bZl%%JXByW{g5,@u{WIJ-@_4h/;1G#NSA1
ACF_PRO_KEY b3JkZXJfaWQ9NzQ2MTV8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE2LTAyLTA5IDExOjQ5OjE5
0. Whoops\Handler\PrettyPageHandler