Created attachment 200693 [details] fix php syntax not valid in php 7.2 With the deprecation of php versions less than 7.1, www/gallery2 needs to be updated to work. The attached patch makes gallery2 work for me. The error the patch solves is: [Wed Jan 02 17:47:26.801016 2019] [php7:error] [pid 36662] [client 192.168.3.23:50754] PHP Fatal error: 'break' not in the 'loop' or 'switch' context in /usr/local/www/gallery2/lib/adodb/adodb-time.inc.php on line 1009
Created attachment 200698 [details] fix php syntax not valid in php 7.2 This revision also fixes the following error [Wed Jan 02 21:16:13.062114 2019] [php7:error] [pid 38285] [client 192.168.3.23:51340] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /usr/local/www/gallery2/modules/core/classes/helpers/GalleryEntityHelper_simple.class:79 I found the fix at https://github.com/bobosch/gallery2/commits/master There are a number of php warnings in httpd-error.log that another project addresses: https://github.com/gregstoll/gallery2/commits/master I am wondering what the right way forward to updating the gallery2 port is.
I plan to commit the fix from bobosch/gallery2 first. After that, we could consider moving to gregstoll/gallery2 since gallery2 upstream is in hibernation.
A commit references this bug: Author: sunpoet Date: Sat Jan 19 20:32:00 UTC 2019 New revision: 490736 URL: https://svnweb.freebsd.org/changeset/ports/490736 Log: Fix PHP 7 issue - Bump PORTREVISION Obtained from: https://github.com/bobosch/gallery2/commit/4ddfafa416ffe5babd95f2a6532742c3ec903275 https://github.com/bobosch/gallery2/commit/4fc50203a12b78217999df00759d70d283efce2f PR: 234557 Submitted by: Matthew Luckie <mjl@luckie.org.nz> Changes: head/www/gallery2/Makefile head/www/gallery2/files/patch-lib-adodb-adodb-time.inc.php head/www/gallery2/files/patch-modules-core-classes-GalleryStorage-GalleryStorageExtras.class
Thanks for committing this. If you leave the bug open I'll send through more patches, as these just stop the fatal errors. There are lots of warnings in php7 on gallery2.
(In reply to mjl from comment #4) I'll try to move to gregstoll/gallery2 this weekend. If so, do you want to submit your patch here or to the new upstream directly?
I found that gregstoll/gallery2 is based on the gallery2 code, not the release tarball. For example, it does not provide language files (*.po) of the themes. I may need to add the patches from gregstoll/gallery2 manually instead of changing upstream to it.
What must I do to update my Gallery 2 application with these fixes? I am running a stock G2 installation on Godaddy using PHO 5.6. PHP 7+ is available. G2 is currently creating many errors, so much that I had to disable logging (error_log). The log file was 990+ MB in about a month ... Please provide detailed instructions.
Created attachment 213513 [details] more php7 patches from https://github.com/gregstoll/gallery2 These are all the patches that are in GitHub that fix php7 warnings in gallery2.
if you commit this patch, can you please remove the modifications to PasswordHelper.class in patch-gregstoll-4d7f661d as the modification introduced a bug: https://github.com/gregstoll/gallery2/issues/13
PHP 7.2 expired today, is this relevant for PHP 7.3 / 7.4 / 8.0 too?
(In reply to Rene Ladan from comment #10) Yes it is still relevant. I'd like to see it committed. Should I condense the patches down into one file? What's the best way forward?
(In reply to mjl from comment #11) I think it would be easiest to generate one patch using "svn diff".
(In reply to mjl from comment #11) If you'd like to follow https://github.com/gregstoll/gallery2, please try to generate the .po files. We could simply change upstream to it with proper GH_TAGNAME and no longer need patch files.
Friendly ping on this one
Looks like we need to move to https://github.com/hlh-restart/gallery2-1 in order to keep it working? Is there any interest of doing so otherwise it's time to say goodbye to this port.
I will take a look at it, and see if I can get a solution that is commit-able. I am using gallery2 with the patch I submitted and I would like to see gallery2 remain as a port.
hello, i am running Gallery version = 2.3.1 core 1.3.0.1 i have been having issues with php versions, i am able to get it running again by getting the hosting to temp downgrade. is there any way to get it working again ? gallery 3 is too much work to start over. i tried https://github.com/hlh-restart/gallery2-1 that says - This is a fork of the now-dormant gallery2 project. The gallery code was written against PHP 5, and there are some changes in PHP 7 that were causing problems for me (as well as a bunch of warnings). I fixed the two bugs I found and cleaned up some of the warnings. Some more fixes for PHP 8.0. This code is based on gallery2 version 2.3.2 (core version 1.3.0.2) FYI - Brad Dutton has revived Gallery 3 that is compatible with PHP 7. I haven't tried it, but you can download it at galleryrevival.com. - im not sure if im missing something but i copy the file to the sever. but the installer\upgrade fails with errors like Deprecated: Non-static method GalleryUtilities::isEmbedded() should not be called statically, assuming $this from incompatible context in: any advise? thanks
(In reply to mjl from comment #16) hello, which patch are you using?
I am using the patch attached to this bug report: https://bz-attachments.freebsd.org/attachment.cgi?id=213513 which is derived from gregstoll's github.
(In reply to mjl from comment #19) thanks, how does it work? if a click the link its a bunch of txt? did it fix the php issue for you?
any newS?
i guess galley2 is done
Hello, In case it can be useful, I modify gallery2 to be compatible with php 8.1; see https://github.com/hlh-restart/gallery2-1 Henri
(In reply to Henri Hennebert from comment #23) Hello, could you please create a patch against ports tree?
(In reply to Zsolt Udvari from comment #24) Such a patch seems cumbersome. I think it would be better to switch the repository to https://github.com/gregstoll/gallery2 (it seems it is supporting php 8) or https://github.com/hlh-restart/gallery2-1 witch I upgrade when I encounter problems with my own use.