After upgrade to PHP 8.1 Next/prev links lead to index.php

77 views
Skip to first unread message

Stian Lund

unread,
Jul 30, 2023, 9:45:03 AM7/30/23
to Gallery 3 Users
Hi, 
my site (shared hosting on Nginx/Linux Debian), recently upgraded to PHP 8.1 from 7.x and after struggling and fixing several issues in Gallery with broken modules/themes I've now noticed all image next/previous links lead to a url like:

What I've tried:
* Disabling all modules
* Doing a clean install and uploading some image

Album pagination links still work:

The only thing logged in the Gallery log is:
2023-07-30 15:23:04 +02:00 --- error: date.timezone setting not detected in /etc/php/8.1/fpm/php.ini falling back to UTC.  Consult http://php.net/manual/function.get-cfg-var.php for help.
That does not seem relevant.

PHPInfo is here:

This is running the latest release from the Github repo.

This being shared hosting, I can't control the Nginx rules, but Gallery has worked OK until the PHP upgrade. A couple years ago I asked the admins to add some custom config to Nginx for Wordpress to work properly:
fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;

Since this is a really new install of 8.1 I'm suspecting there might be some things the admins have forgotten to setup to break the Gallery in this way.

Any ideas what can be done to figure out what's causing this?

Stian



Stian Lund

unread,
Jul 30, 2023, 9:56:08 AM7/30/23
to Gallery 3 Users
Some additional information: I get some log output that *might* be relevant, when trying to open the "Latest Updates" module page. Since this mentions "next_page_link" I'm thinking this error might be related - however, the issue with missing links also appears if the "Latest Updates" module is disabled:

2023-07-30 15:49:42 +02:00 --- error: Error [ 0 ]: Attempt to assign property "next_page_link" on null
/meta/www/s/stian/gallery/modules/latestupdates/controllers/latestupdates.php [ 297 ]
#0 [internal function]: latestupdates_Controller->updates()
#1 /meta/www/s/stian/gallery/system/core/Kohana.php(302): ReflectionMethod->invokeArgs()
#2 /meta/www/s/stian/gallery/system/core/Event.php(208): Kohana_Core::instance()
#3 /meta/www/s/stian/gallery/application/Bootstrap.php(67): Event_Core::run()
#4 /meta/www/s/stian/gallery/index.php(124): require('...')
#5 {main}


S.

David and Jackie Armstrong

unread,
Jul 30, 2023, 3:48:16 PM7/30/23
to gallery...@googlegroups.com
Stian,

Does the pagination work correctly when using the Widewind theme? If it does (it does in my site at https://thejigasaurus.com ), I would check paginator.html.php in the views path of your current theme.

Regards,

David Armstrong

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/c0eef1f7-a83e-4b63-ad40-0b3ad3f9895cn%40googlegroups.com.

Stian Lund

unread,
Jul 30, 2023, 4:13:05 PM7/30/23
to Gallery 3 Users
Hello David, and thanks a lot for the reply :)

Unfortunately, it does the same thing with the default theme. And I did a clean install, creating new prefixed tables for a test install, and the same thing happens there. Which leads me to think it must be something with the 8.1 PHP upgrade and possibly with MySQL, maybe it's unable to get the links to the next/previous images from the DB. Possibly related to the same "assign property "next_page_link" on null" shown for the Latest Updates module.

But really strange there's absolutely nothing being logged...

Are you running PHP 8 as well? 

regards,
Stian

David and Jackie Armstrong

unread,
Jul 31, 2023, 3:08:34 AM7/31/23
to gallery...@googlegroups.com
Yes I am. I have seen similar messages before during my migration to php 8 though not necessarily for pagination. I’m pretty sure there will be some code changes needed to meet php 8 compatibility requirements. I will look into this later as out today.

I would also look at Brad Dutton’s GitHub repository as he has updated some modules beyond the official Gallery the Revival download.

Regards,

David Armstrong.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
--
Sent from Gmail on iPad

David and Jackie Armstrong

unread,
Jul 31, 2023, 4:34:34 AM7/31/23
to gallery...@googlegroups.com
Stian,

I've seen this issue before with another member of this group. Have a look at my post of 7 Jun 2023 with the title:

Re: [gallery-3-users] Re: Custom Menu Gallery3

I got it working to overcome exactly the same issue by using Brad Dutton's more recent version of the latestupdates module.

Regards,

David Armstrong

On Sun, 30 Jul 2023 at 21:13, Stian Lund <stia...@gmail.com> wrote:
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Stian Lund

unread,
Jul 31, 2023, 7:52:53 AM7/31/23
to Gallery 3 Users
Hi again David,
Yes, I did look at that posting earlier when searching for similar issues. At the moment I've just disabled the Latest Updates module anyway.

BUT - turns out that doing a 'git clone' of the most recent repo code instead of actually downloading the gallery3-3.1.5 release seems to have been the issue. After reverting to the official release version things are working again - at least with the next/prev links on photo pages :)

What happened was, after the update to PHP8 I got strange errors, so figured I might just as well download the *latest* code from the repo, as there are commits there for 8.1 done after the official 3.1.5 release. So I did a git clone and used that code. 

Apparently, there must be errors in the commits done after the Oct. 27 2021 release. But I am in way good enough with PHP to understand which one.
Basically this could be *really bad* - of course just cloning an active repo and not downloading an official release might cause all kinds of issues, but with the little activity going on I would think it safe to assume the repo code is in a "good enough" state to be used, but apparently not. I don't know how active Brad is currently - there's not been any activity since last August but I hope he's not completely abandoned the effort? 

The *latest* code seem to have also broken some other stuff like the Album Permissions dialog as well. It just showed up "blank" earlier, now I get the permission toggles again.

David - what *would* be interesting is if you could do a quick test, just download the current repo code (not the release) and try a test install on your server - see if you get the same issue in a clean install of that code?
Then we'd know that there's a commit done after the 3.1.5 release that breaks the next/prev buttons.

Thanks for your help,
Stian

David and Jackie Armstrong

unread,
Jul 31, 2023, 1:41:07 PM7/31/23
to gallery...@googlegroups.com
Stian,

As requested I downloaded the master from:


and did a fresh install to my server running php 8.1 and uploaded a few photos to:


This produced the same error with the pagination buttons taking me back to the homepage of the gallery installation. Zero errors are reported in the error log file.

I have not followed this route for my current gallery3 installation, instead using the install package from the gallery revival site prior to migrating from gallery2, and the adding modules and edits as described here:


I started using github late in the migration, so winmerge has been used to document the changes made to the modules etc. to provide a similar style to the original gallery2 site and for php 8.1 compatibility.

Regards,

David Armstrong.



--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Stian Lund

unread,
Jul 31, 2023, 3:34:06 PM7/31/23
to Gallery 3 Users
Thank you for your test David,

I think this shows that there's an error in some of the commits done after the 3.1.5 release. If I were to make a guess I'd say this change looks like a likely candidate:

However, my PHP skills are not up to understanding if there might be an issue with that specific code or how to fix it. Hopefully Brad or someone who might know takes a look at this so we can avoid this error getting into a future release of Gallery.

Anyway, thanks a lot for your inputs - very helpful for figuring out the issue was not necessarily with my install :)
Thanks also for the link to your repo - always looking for good and working modules to test!

And I have to say I think it's pretty amazing there's still a community around for Gallery, and that it's still working fine with minor tweaks two decades after its release :)

Thanks again and cheers,
Stian
Reply all
Reply to author
Forward
0 new messages