PHP warning in td_wp_booster_functions.php

Posted in: Newspaper
Post count: 13

We have this warning in our error log.

“PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/studentlife.com.cy/htdocs/wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php on line 1019

Requests that caused it so far

request: “GET /author/constantinos-tsiartas/ HTTP/1.1”
request: “GET /tag/midnight/ HTTP/1.1”

Post count: 23312

Hello StudentLife,

Please ensure that you have fully updated your theme to the latest version of it (Newspaper 7.1.1) and this was made only via FTP because this is the surest method in this regard. Also, if you are using the PHP 7 version, please notice that this type of version was not been tested with our theme and might appear some unknown issues. Please try to rule out the conflicting plugin through disabling all the active plugins, leave just Visual Composer to active, clear all your caches and install only the plugins that come bundled with our theme.

Hope this helps and let us know how it goes!

Thanks for your understanding!

Post count: 13

Hi Catalin,

I always update the them through SFTP.

After two minutes of investigating the issue I have found that you had some ifs going on above the foreach. I added and if statement above the foreach which checks if the $classes varialble isset and not empty and the warning have been elimninated.

File: Newspaper/includes/wp_booster/td_wp_booster_functions.php
Line: 1019

Above this line foreach ($classes as $key => $value) { I added if(isset($classes) && !empty($classes)):.

Below this line return $classes; i added endif;

Please check if this is the correct way of fixing this warning and let me know.

Thanks

Post count: 23312

Hello StudentLife,

Thank you for your notification. We will do some further investigation in this regard and if we will find any irregularity through source code we will consider to solve it.

Thanks for the message!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.