[Support request] PHP 8 Warnings

Home Forums Support [Support request] PHP 8 Warnings

Home Forums Support PHP 8 Warnings

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2365414
    Amy

    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

    #2366032
    David
    Staff
    Customer Support

    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 ?

    #2366230
    Amy

    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!

    #2366702
    Tom
    Lead Developer
    Lead Developer

    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.

    #2391490
    Amy

    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

    #2392277
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.