- This topic has 7 replies, 3 voices, and was last updated 2 years, 3 months ago by
Graham.
-
AuthorPosts
-
April 9, 2023 at 7:15 am #2602919
Graham
I use the last version of GP and GP Premium that worked before blocks were required with GP, because I run ClassicPress instead of WordPress.
Everything is fine using PHP 7.x but when I use 8.x I get errors saying “Trying to access array offset on value of type null….”
The two files it complains about are:
gp-premium/page-header/functions/functions.php
gp-premium/blog/functions/images.phpThe types of lines it doesn’t like are:
if ( '' !== $options[ 'content' ] ) {
I realize I’m using old versions, but was wondering if there is now a new way of wording the “if” statement where the array is ” meaning empty (Null) I assume.
Did some searching on Google but couldn’t find any answers. Tried using the word empty instead, but that didn’t work.
Thanks in advance.
April 9, 2023 at 11:39 am #2603272Leo
StaffCustomer SupportHi Graham,
Sorry, I’m not familiar with ClassicPress – What’s the advantage of using that over the Classic Editor plugin?
And just to confirm, do you see the same issue when using WordPress?
April 9, 2023 at 12:10 pm #2603308Graham
ClassicPress is a fork of WordPress 4.9 and has no Gutenberg code or functions. It works the same as WP used to, with the TinyMCE editor as the only editor.
The code works fine with PHP 7.x but throws an error with PHP 8.x
The ” option appears to be incompatible with the newer PHP. It causes a PHP error as a syntax type error for a null value.
I was just hoping someone might know why and if there was a different value you need to use.
April 9, 2023 at 12:45 pm #2603341Leo
StaffCustomer SupportI’ll forward this to our developer to check 🙂
April 10, 2023 at 3:20 am #2603825David
StaffCustomer SupportHi there,
try changing that line to:
if ( isset( $options['content'] ) ) {
April 10, 2023 at 4:57 am #2603920Graham
That fixed the error in gp-premium/blog/functions/images.php
But there are over 25 similar errors in gp-premium/page-header/functions/functions.php
And they are all worded differently. They all have if ( ” at the start, but the rest of the line is different.
I tried the fix on one line and it produced even more errors. I’m afraid it’s all a bit beyond me.
Guess I’ll just have to stick with PHP 7.4
Thanks for your help anyway.
April 10, 2023 at 5:51 am #2603997David
StaffCustomer SupportYeah their could be a quite a lot of changes. And the old Page Headers module has been deprecated some time now, so we wont be updating that.
You could of course use the Header Element instead in the latest version of GeneratePress, that is still suppprted and that does not require blocks. The only functions that GP requires blocks for is the Block Element…
April 10, 2023 at 6:10 am #2604020Graham
Actually, the change I made to gp-premium/blog/functions/images.php caused the post featured image to appear on single posts, so I had to undo that.
The original post I made when GP stopped working on CP is:
https://generatepress.com/forums/topic/cannot-configure-gp-premium-on-new-classicpress-site/
So, I’ve gotten a couple of extra years out of it. Just have to hope PHP 7.4 is still available with my hosting for a few more years too.
-
AuthorPosts
- You must be logged in to reply to this topic.