Site logo

Archived topic

PHP 8 Warnings

5 replies · Started by Amy on October 6, 2022

Viewing posts 1–6 of 6

Hi there,

we use GP Premium and are curretnly switching to PHP 8. However once we change to PHP 8 we receive the following warnings on most, but not all of our pages on our site:

Warning: Undefined array key "mobile_content_top" in /home/XXXX/plugins/gp-premium/blog/functions/generate-blog.php on line 345

Warning: Undefined array key "mobile_content_right" in /home/XXXX/plugins/gp-premium/blog/functions/generate-blog.php on line 346

Warning: Undefined array key "mobile_content_left" in /home/XXXX/plugins/gp-premium/blog/functions/generate-blog.php on line 347

How do we need to go about to remove these warnings without changing our php.ini?

Thanks

Hi there,

can you go to Customizer > Layout > Container, and in the Padding fields, can you check the Mobile options have any values in them ?

Thanks for the reply.

Seems like that option does not exist. The only place where I think this might be set instead (Spacing -> Content) does not have a mobile icon/option. Here are some screenshots.

Screenshot
Screenshot 2
Screenshot 3

We run GP Premium 2.1.2, that is the latest version right?

Additionally I noticed when logged in there are more warnings. The mobile ones are more important though as they show on the live site.

Thanks for the help!

Hi there,

Do you have any custom functions added to the site? Those values should have defaults set in the theme, but it's possible that the defaults are being filtering incorrectly.

Hi Tom,

thanks for the help.

I was able to fix this by adding the deflaut swtting to the $generare_spacing_defaults array in inc/add-ons/spacing.php (line 22)

The default spacings were missing here for the one that showed the warnings.

Let me know if that approach was fine. It certainly worked.

Best,
Tino

inc/addons/spacing.php is no longer a file in GP Premium. Can you make sure you're using the latest version? We're currently on 2.2.0.

This archived topic is closed to new replies.