Announcement

#1 2020-01-01 12:50:34

fabibz
Member
2020-01-01
4

php/mysql errors after upgrade

Hello/Hi/Greetings,

just updated from 2.9.4 to 2.10.1.
if I open the site with a "fresh" browser, with no cookies from previous session, i can see the site OK but once I login or retry  later to open the site, I'm stuck with:

Warning: array_merge(): Argument #2 is not an array in /var/www/jd/piwigo/include/functions_user.inc.php on line 380
Warning: Invalid argument supplied for foreach() in /var/www/jd/piwigo/include/functions_user.inc.php on line 382
Notice: Undefined index: id in /var/www/jd/piwigo/include/functions_user.inc.php on line 408
Notice: Undefined index: status in /var/www/jd/piwigo/include/functions_user.inc.php on line 408
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 '' at line 3
SELECT cat_id
  FROM piwigo_user_access
  WHERE user_id =
; in /var/www/jd/piwigo/include/dblayer/functions_mysqli.inc.php on line 856

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/jd/piwigo/include/dblayer/functions_mysqli.inc.php:917 Stack trace: #0 /var/www/jd/piwigo/include/functions_user.inc.php(583): query2array('\nSELECT cat_id\n...', NULL, 'cat_id') #1 /var/www/jd/piwigo/include/functions_user.inc.php(408): calculate_permissions(NULL, NULL) #2 /var/www/jd/piwigo/include/functions_user.inc.php(293): getuserdata(3, true) #3 /var/www/jd/piwigo/include/user.inc.php(60): build_user(3, true) #4 /var/www/jd/piwigo/include/common.inc.php(154): include('/var/www/jd/piw...') #5 /var/www/jd/piwigo/index.php(11): include_once('/var/www/jd/piw...') #6 {main} thrown in /var/www/jd/piwigo/include/dblayer/functions_mysqli.inc.php on line 917

What must I do to fix this?

Thanks a lot and happy new year 2020!

Piwigo version: 2.10.1
PHP version: PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: Oct 28 2019 12:07:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
MySQL version: mysql  Ver 14.14 Distrib 5.7.28, for Linux (i686) using  EditLine wrapper
Piwigo URL: http://jacquesdupuy.com/piwigo

Offline

 

#2 2020-01-01 20:10:31

fabibz
Member
2020-01-01
4

Re: php/mysql errors after upgrade

any clues to solve this?

Offline

 

#3 2020-01-01 23:24:14

fabibz
Member
2020-01-01
4

Re: php/mysql errors after upgrade

piwigo_user_access table is empty and user_id = not even specified so the sql syntax error

Offline

 

#4 2020-01-02 02:58:58

erAck
Only trying to help
2015-09-06
1147

Re: php/mysql errors after upgrade

An empty user_access table shouldn't be the cause (also empty here and no problem). The problem is a malformed query, i.e. no operand for the
WHERE user_id =
clause, not the empty table. For which then subsequently the query2array() call fatal errors.

Most likely (it's the only place where user_id is in conjunction with .USER_ACCESS_TABLE.) caused by include/functions_user.inc.php function calculate_permissions() where the query is build with
WHERE user_id = '.$user_id.'
and it looks like $user_id was passed empty.

No idea how an empty $user_id could get passed to calculate_permissions() if you are actually logged in. (and even if not, the user should be a guest user).


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

Offline

 

#5 2020-01-02 11:20:03

fabibz
Member
2020-01-01
4

Re: php/mysql errors after upgrade

So, what can I do to solve this?
Must I reinstall Piwigo?
Which folders must I backup to keep the images and text?
And how I rebuild the galley after that?

Offline

 

Board footer

Powered by FluxBB

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