php8.1 issue when uploading a picture #1654

Closed
opened 2026-10-05 00:51:47 +02:00 by adam · 5 comments
Owner

Hi,
we cannot upload a picture to an album, please find errors & warnings in httpd logs :

[Thu Mar 30 09:46:53.382592 2023] [php:warn] [pid 14085] [client 134.184.232.206:42111] PHP Warning:  Undefined array key "" in /var/www/html/piwigo/include/functions_html.inc.php on line 125, referer: https://<tld>/admin.php?page=photos_add&album=149
[Thu Mar 30 09:46:53.383020 2023] [php:warn] [pid 14085] [client 134.184.232.206:42111] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/include/functions_html.inc.php on line 129, referer: https://<tld>/admin.php?page=photos_add&album=149
[Thu Mar 30 09:48:35.305264 2023] [php:warn] [pid 14155] [client 134.184.232.206:35752] PHP Warning:  Undefined array key 0 in /var/www/html/piwigo/include/ws_functions/pwg.images.php on line 1480, referer: https://<tld>/admin.php?page=photos_add&album=149
[Thu Mar 30 09:48:35.306782 2023] [php:error] [pid 14155] [client 134.184.232.206:35752] PHP Fatal error:  Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php:132\nStack trace:\n#0 /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()\n#1 /var/www/html/piwigo/include/ws_functions/pwg.images.php(1482): pwg_query()\n#2 /var/www/html/piwigo/include/ws_core.inc.php(600): ws_images_upload()\n#3 /var/www/html/piwigo/include/ws_protocols/rest_handler.php(41): PwgServer->invoke()\n#4 /var/www/html/piwigo/include/ws_core.inc.php(281): PwgRestRequestHandler->handleRequest()\n#5 /var/www/html/piwigo/ws.php(22): PwgServer->run()\n#6 {main}\n  thrown in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php on line 132, referer: https://<tld>/admin.php?page=photos_add&album=149

The upload interface is missing the album list as shown in the screenshot :

image

The only way to get back to the Piwigo interface is to browse to another page, cancelling the upload does nothing.

After that a "null" album is created, the uploaded picture is orphaned and the following errors are shown :

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 195

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 195

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 196

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 196

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 197

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 197

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 198

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 198

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 199

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 199

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 200

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 200

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 201

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 201

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202

Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202

Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202

As shown in the web UI :

image

Errors on the httpd logs :

[Thu Mar 30 09:56:06.627294 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 195, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628396 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 195, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628502 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 196, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628588 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 196, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628687 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 197, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628778 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 197, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628855 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 198, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.628887 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 198, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629009 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 199, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629090 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 199, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629118 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 200, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629140 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 200, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629161 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 201, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629207 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 201, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629309 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629331 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629353 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php
[Thu Mar 30 09:56:06.629374 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php

Server information :

*Piwigo 13.6.0
*PHP 8.1.16
*httpd-2.4.6-97.el7.centos.4.x86_64

Let me know if we can provide more information about this issue, thanks.

Hi, we cannot upload a picture to an album, please find errors & warnings in httpd logs : ``` [Thu Mar 30 09:46:53.382592 2023] [php:warn] [pid 14085] [client 134.184.232.206:42111] PHP Warning: Undefined array key "" in /var/www/html/piwigo/include/functions_html.inc.php on line 125, referer: https://<tld>/admin.php?page=photos_add&album=149 [Thu Mar 30 09:46:53.383020 2023] [php:warn] [pid 14085] [client 134.184.232.206:42111] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/include/functions_html.inc.php on line 129, referer: https://<tld>/admin.php?page=photos_add&album=149 [Thu Mar 30 09:48:35.305264 2023] [php:warn] [pid 14155] [client 134.184.232.206:35752] PHP Warning: Undefined array key 0 in /var/www/html/piwigo/include/ws_functions/pwg.images.php on line 1480, referer: https://<tld>/admin.php?page=photos_add&album=149 [Thu Mar 30 09:48:35.306782 2023] [php:error] [pid 14155] [client 134.184.232.206:35752] PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php:132\nStack trace:\n#0 /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()\n#1 /var/www/html/piwigo/include/ws_functions/pwg.images.php(1482): pwg_query()\n#2 /var/www/html/piwigo/include/ws_core.inc.php(600): ws_images_upload()\n#3 /var/www/html/piwigo/include/ws_protocols/rest_handler.php(41): PwgServer->invoke()\n#4 /var/www/html/piwigo/include/ws_core.inc.php(281): PwgRestRequestHandler->handleRequest()\n#5 /var/www/html/piwigo/ws.php(22): PwgServer->run()\n#6 {main}\n thrown in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php on line 132, referer: https://<tld>/admin.php?page=photos_add&album=149 ``` The upload interface is missing the album list as shown in the screenshot : ![image](https://user-images.githubusercontent.com/43171930/228768374-1a72fcd9-c5c8-4db9-b61f-fec0ee6d43e3.png) The only way to get back to the Piwigo interface is to browse to another page, cancelling the upload does nothing. After that a "null" album is created, the uploaded picture is orphaned and the following errors are shown : ``` Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 195 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 195 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 196 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 196 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 197 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 197 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 198 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 198 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 199 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 199 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 200 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 200 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 201 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 201 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202 Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202 Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202 ``` As shown in the web UI : ![image](https://user-images.githubusercontent.com/43171930/228770139-0c07fdb5-23a8-42cc-86f4-6854e6006eb1.png) Errors on the httpd logs : ``` [Thu Mar 30 09:56:06.627294 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 195, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628396 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 195, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628502 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 196, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628588 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 196, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628687 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 197, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628778 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 197, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628855 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 198, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.628887 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 198, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629009 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 199, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629090 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 199, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629118 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 200, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629140 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 200, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629161 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 201, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629207 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 201, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629309 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629331 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629353 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Undefined array key "cat" in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php [Thu Mar 30 09:56:06.629374 2023] [php:warn] [pid 14157] [client 134.184.232.206:29192] PHP Warning: Trying to access array offset on value of type null in /var/www/html/piwigo/admin/albums.php on line 202, referer: https://<tld>/admin.php ``` Server information : *Piwigo 13.6.0 *PHP 8.1.16 *httpd-2.4.6-97.el7.centos.4.x86_64 Let me know if we can provide more information about this issue, thanks. <!-- github-sync-id:1647118541 -->
adam closed this issue 2026-10-05 00:51:47 +02:00
Author
Owner

Why not a single reply about this issue ?

upgrading to latest version does not solve those problem, is this software still supported ?

Why bother reporting problems if they are not even considered by devs ?

Why not a single reply about this issue ? upgrading to latest version does not solve those problem, is this software still supported ? Why bother reporting problems if they are not even considered by devs ? <!-- github-comment-id:1545516016 -->
Author
Owner

Hi,

-Do you had a look at https://piwigo.org/forum/
-Piwigo is supported, see latest version 13.7 (https://piwigo.org/forum/viewtopic.php?id=32832)
-also read this post about php version (https://piwigo.org/forum/viewtopic.php?pid=186742#p186742)
-last but not least read the article (in french) from @plegall https://framablog.org/2023/03/28/piwigo-la-photo-en-liberte/

kind regards
Phil (not a dev, just a user!)

Hi, -Do you had a look at https://piwigo.org/forum/ -Piwigo is supported, see latest version 13.7 (https://piwigo.org/forum/viewtopic.php?id=32832) -also read this post about php version (https://piwigo.org/forum/viewtopic.php?pid=186742#p186742) -last but not least read the article (in french) from @plegall https://framablog.org/2023/03/28/piwigo-la-photo-en-liberte/ kind regards Phil (not a dev, just a user!) <!-- github-comment-id:1545920497 -->
Author
Owner

Hi
Have you test version master
The version master IS different for category
Kind regards

Hi Have you test version master The version master IS different for category Kind regards <!-- github-comment-id:1545932626 -->
Author
Owner

I can't reproduce this problem.

Did you create the album on the upload page? Or is it an existing album?

I can't reproduce this problem. Did you create the album on the upload page? Or is it an existing album? <!-- github-comment-id:1681880087 -->
Author
Owner

No feedback, I cloe this issue we can't reproduce.

No feedback, I cloe this issue we can't reproduce. <!-- github-comment-id:2022839584 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1654