Announcement

  •  » Engine
  •  » 2.9 Bug Squash

#1 2017-05-12 15:24:16

digibirdtrek
Member
2015-01-06
10

2.9 Bug Squash

Hello All,

I've been doing some coding with regard to Piwigo and have found a few bugs.  Some got squashed with the full 2.9 release, others not.  I'll post them here for reference sake.  The higher ups can determine if it is worth addressing. 

Bug 1:

functions_user.inc.php (line 715): Unquoted field generates database error

Code:

 WHERE user_id = '.$conf['default_user_id'].'

should be:

Code:

WHERE user_id = \''.$conf['default_user_id'].'\'

Piwigo version: 2.9
PHP version: 7.1
MySQL version: 5.5

Last edited by digibirdtrek (2017-05-12 15:35:23)

Offline

 

#2 2017-05-12 16:04:32

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: 2.9 Bug Squash

Hi digibirdtrek,

Do you use an external table to list your users? Because in Piwigo, user_id is an integer value and $conf['default_user_id'] is also one. It should not be a problem not to quote this value for the SQL query.

Offline

 

#3 2017-05-12 16:10:01

digibirdtrek
Member
2015-01-06
10

Re: 2.9 Bug Squash

plg wrote:

Hi digibirdtrek,

Do you use an external table to list your users? Because in Piwigo, user_id is an integer value and $conf['default_user_id'] is also one. It should not be a problem not to quote this value for the SQL query.

Not using an external table, but am using a different DB manager.  The error generated was a result of mysqli looking for a column of that name (default user name), instead of a value in the condition.

Worth noting, I was working with a 2.9 RC2 install.  I checked the defaults and it is an integer.  Trying to find where it got switch to a string as I have not directly modified that value.

Last edited by digibirdtrek (2017-05-12 16:30:16)

Offline

 

#4 2017-05-12 16:18:54

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: 2.9 Bug Squash

digibirdtrek wrote:

[...] am using a different DB manager

?!? you're not using MySQL? Piwigo is only compatible with MySQL!

Offline

 

#5 2017-05-12 16:33:28

digibirdtrek
Member
2015-01-06
10

Re: 2.9 Bug Squash

plg wrote:

digibirdtrek wrote:

[...] am using a different DB manager

?!? you're not using MySQL? Piwigo is only compatible with MySQL!

Not a different database vendor/driver, different manager, specifically ADOdb.  This allows me to connect to multiple databases at the same time within Piwigo.  I wrote a bridge between AODdb and Piwigo, among other on going efforts.

I found the problem and it was on my end.  The default_user_id in the config_default.inc.php  was a string.  I converted the file to an array.  When running the batch the default_user_id got set to 'guest_id' because it was using the value of guest_id.

Last edited by digibirdtrek (2017-05-12 16:54:43)

Offline

 
  •  » Engine
  •  » 2.9 Bug Squash

Board footer

Powered by FluxBB

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