#1 2021-10-02 09:46:19


Mugshot bug

Hi there,

i searched the forums, there seem to be other bugs in mugshot… but none I found refers to the line I get the error:

: unserialize() expects parameter 1 to be string, array given in
on line

Line may be different because I tried some of the fixes I found. Line 249 for me is:

$plugin_config = unserialize (conf_get_param(MUGSHOT_ID));

in function insert_tag_list()

any solution for this?



#2 2021-10-05 07:05:15


Re: Mugshot bug

I get this too. I fixed it once in a private copy -- it's deprecated behavior in a PHP function, so it'll continue to work for a while and then break entirely in some future version of PHP. It gives the line, easy enough to fix in the PHP code after reading up on the function as I remember it.

As I recall there was a thread when I brought this up a while ago and several users helped figure out a better solution than my original one; which did work on my site.

(That was before the new release by the MugShot author, which fixed other things and added things but didn't address this; this isn't urgent, except the message is annoying. Looks like it's the same function though so the same fix should be good.)



#3 2022-01-30 17:55:36


Re: Mugshot bug

I remember fixing different errors to this with earlier versions, but those fixes didn't seem to help with this.  My coding skills aren't good enough to really understand what the function is meant to do, but I have implemented a fix which has stopped the error occuring and the plugin still seems to work.

I changed line 247 (and added another line below it) so it looks like...

  if ( is_string( conf_get_param(MUGSHOT_ID) ) ) $plugin_config = unserialize(conf_get_param(MUGSHOT_ID));
  else $plugin_config = conf_get_param(MUGSHOT_ID);

My guess is that maybe piwigo changed the function conf_get_param so that it returns an array rather than a serialised string and that the unserialize step isn't needed.  However, since I don't know if this really is the case or not the 2 lines above check if what is returned is a string or not.  If it's a string it will unserialize it, and if it isn't a string it skips the unserialize and just assumes it will be an array already.

If anyone with more knowledge has any improvements or insight that would be great - until then this at least seems to work?



#4 2022-03-29 07:08:04


Re: Mugshot bug

Hi I am having a similiar error with mugshot, i have a fresh install of Piwigo and when in install the Mugshot pluging and activate it i get a small popup that says an error has occurred and the plug does not work. If I try to update it from 2.0.2 to 2.0.3 that fails as well. Digging through some logs I see:

[Sun Mar 27 05:34:10.344392 2022] [php7:warn] [pid 24417] [client] PHP Warning:  [mysql error 1062] Duplicate entry 'MugShot' for key 'PRIMARY'\nINSERT INTO pi
wigo_config (param,value,comment) VALUES ("MugShot","","MugShot configuration values"); in /var/www/html/piwigo/include/dblayer/ on line 847, referer: http

Any help with this would be greatly appreciated, everyting seems to be working with all this except this one plugin that I would much like to use.

Piwigo 12.2.0
Operating system: Linux
PHP: 7.4.3 (Show info) [2022-03-27 06:16:10]
MySQL: 5.5.5-10.3.34-MariaDB-0ubuntu0.20.04.1 [2022-03-27 06:16:10]
Graphics Library: External ImageMagick 6.9.10-23
Cache size 45.99 Mo   calculated 1 day ago Refresh



Board footer

Powered by FluxBB

github twitter newsletter Donate © 2002-2022 · Contact