Announcement

  •  » Extensions
  •  » Additional Pages and PWG Stuffs: getting error php7.4.8

#1 2020-08-09 02:34:07

Nigel-Aves
Member
2015-09-22
33

Additional Pages and PWG Stuffs: getting error php7.4.8

Hello/Hi/Greetings,

I have just rebuilt a server (non-production at moment) using Ubuntu 20.04.01. Unfortunately ( :) ) there seems to be a few issues when trying to use PHP 7.4 with these two extensions. The two I have caught are:  Additional Pages and PWG Stuffs.

I did originally post in troubleshooting, but thought this forum might be better. I'm still unsure though if this error is from the plugins or from core PIWIGO, but this stops PIWIGO from opening, which is a bit bad if you don't know what to do next! ....

Piwigo version: Piwigo 2.10.2
PHP version: 7.4.8
MySQL version: 8.0.21
Ubuntu 20.04.01 LTS

Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups, level, permalink, standalone
FROM piwigo_additionalpages
WHERE id = 9' at line 1
SELECT id, title, lang, content, users, groups, level, permalink, standalone
FROM piwigo_additionalpages
WHERE id = 9; in /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php on line 856


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php:220 Stack trace: #0 /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/plugins/AdditionalPages/additional_page.php(39): pwg_db_fetch_assoc() #1 /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/plugins/AdditionalPages/main.inc.php(68): include('/home/soft-focu...') #2 /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/include/functions_plugins.inc.php(264): section_init_additional_page() #3 /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/include/section_init.inc.php(637): trigger_notify() #4 /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/index.php(12): include('/home/soft-focu...') #5 {main} thrown in /home/soft-focus-imagining/domains/gallery-adult.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php on line 220



Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups, show_title, id_line, width
FROM piwigo_stuffs
LEFT JOIN piwigo_user_gr' at line 1

SELECT DISTINCT id, name, path, datas, groups, show_title, id_line, width
FROM piwigo_stuffs
LEFT JOIN piwigo_user_group
  ON user_id = 2
WHERE (users IS NULL OR users LIKE "%guest%")
  AND (groups IS NULL OR groups REGEXP CONCAT("(^|,)",group_id,"(,|$)"))
  AND level <= 0
  AND on_home = "true"
ORDER BY pos ASC
; in /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php on line 856


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php:220 Stack trace: #0 /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/plugins/PWG_Stuffs/class.inc.php(73): pwg_db_fetch_assoc() #1 /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/plugins/PWG_Stuffs/class.inc.php(35): stuffs->get_modules() #2 /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/plugins/PWG_Stuffs/main.inc.php(53): stuffs->__construct() #3 /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/include/functions_plugins.inc.php(264): load_stuffs() #4 /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/index.php(28): trigger_notify() #5 {main} thrown in /home/soft-focus-imagining/domains/gallery.soft-focus-imagining.com/public_html/include/dblayer/functions_mysqli.inc.php on line 220

Offline

 

#2 2020-08-09 14:33:15

erAck
Only trying to help
2015-09-06
577

Re: Additional Pages and PWG Stuffs: getting error php7.4.8

For the Additional Pages plugin you need to apply these two patches that escape the groups column which now is a keyword in MySQL 8
[Github] AdditionalPages commit e1473d52
[Github] AdditionalPages commit eb323ab2

(append a .patch extension after the URL to obtain the raw patch, this board software tries to be too smart and removes it)

Probably something similar needs to be done for the PWG Stuff plugin.

Update:
You can try to apply this patch from the pull request I created:
https://github.com/Piwigo/PWG_Stuffs/pu … c2d4.patch

Please give feedback whether it works or not.

Last edited by erAck (2020-08-09 16:22:47)


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2020-08-10 01:10:35

Nigel-Aves
Member
2015-09-22
33

Re: Additional Pages and PWG Stuffs: getting error php7.4.8

erAck, (in case I forget to say it at the end "A Big Thank You")

I know nothing about GIThub, but the first two links you supplied gave me all the corrections I needed to know.  So I went through all the listed files making the change. Worked straight out the box!

I then looked at PWG_stuff, went through all the files looking for "groups" and made the same changes, and WOW that now works as well!

There are still issues with AdvancedMenuManager and META plugins (and possibly a whole lot more), but those are inconsequential to the running of my web-site, so I've deactivated those plugins.

I think somewhere there should be a bit of a warning about php7.4, a lot of people could get caught out and if the errors occur so you cannot get to the admin/plugins page (as happened in my case) it could get messy for them!

I have one more thing to look at on the server, mod_pagespeed, then it will go live early next week.

Once more, many thanks, and if you ever get the Colorado, the beers are on me ....

Nigel.

Offline

 

#4 2020-08-10 01:28:37

erAck
Only trying to help
2015-09-06
577

Re: Additional Pages and PWG Stuffs: getting error php7.4.8

It's not about PHP 7.4, it's about MySQL 8 where groups is a keyword now that's also used as a column name, hence needs to be escaped/backtickquoted.

For Advanced Menu Manager there's this patch still pending in a pull request
https://github.com/Piwigo/AMenuManager/ … 2a35991444

and the Grum Plugin Classes it needs has pending
https://github.com/Piwigo/GrumPluginCla … a8c2f69181

Don't know what a META plugin would be.


Running Piwigo at https://erack.net/gallery/

Offline

 
  •  » Extensions
  •  » Additional Pages and PWG Stuffs: getting error php7.4.8

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2020 · Contact