The simpler media website CMS
When adding an album, zenphoto crashes because of "Unknown column 'lastchange' in 'field list'" error.
Here is an example:
... : Erreur MySQLi : INSERT INTO [Préfixe]albums
(folder
, show
, mtime
, lastchange
, title
, parentid
) VALUES ('lieux/groenland/arriere-scene', '1', '1571960469', '2019-10-24 19:47:51', 'arriere-scene', '794') a échoué. MySQLi a renvoyé l’erreur Unknown column 'lastchange' in 'field list' dans /home3/mahaman1/public_html/photos/zp-core/functions-db-MySQLi.php à la ligne 95
trigger_error called from query (functions-db-MySQLi.php [95])
from PersistentObject->save (class-persistentobject.php [352])
from PersistentObject->load (class-persistentobject.php [302])
from PersistentObject->instantiate (class-persistentobject.php [86])
from Album->__construct (class-album.php [1270])
from newAlbum (class-album.php [26])
from Gallery->sortAlbumArray (class-gallery.php [810])
from Album->getAlbums (class-album.php [1371])
from AlbumBase->getAlbumThumbImage (class-album.php [532])
from fluid_getAlbumThumbImage (functions.php [369])
from fluid_printCustomAlbumThumbImage (functions.php [333])
from include (inc_print_album_thumb.php [17])
from include (gallery.php [22])
from include (index.php [12])
from include (index.php [130])
from index.php [45]
The same error occurs on the images table:
... : Erreur MySQLi : INSERT INTO [Préfixe]images
(filename
, albumid
, show
, mtime
, lastchange
, width
, height
) VALUES ('190909_092033_zodiac.jpg', '820', '1', '1571963606', '2019-10-24 20:36:26', '4096', '2731') a échoué. MySQLi a renvoyé l’erreur Unknown column 'lastchange' in 'field list' dans /home3/mahaman1/public_html/photos/zp-core/functions-db-MySQLi.php à la ligne 95
trigger_error called from query (functions-db-MySQLi.php [95])
from PersistentObject->save (class-persistentobject.php [352])
from PersistentObject->load (class-persistentobject.php [302])
from PersistentObject->instantiate (class-persistentobject.php [86])
from Image->__construct (class-image.php [154])
from newImage (class-image.php [53])
from AlbumBase->sortImageArray (class-album.php [1134])
from Album->getImages (class-album.php [1404])
from fluid_getAlbumThumbImage (functions.php [361])
from fluid_printCustomAlbumThumbImage (functions.php [333])
from include (inc_print_album_thumb.php [17])
from include (album.php [34])
from include (index.php [130])
from index.php [45]
Comments
The lastchange field was added to the images and albums (and other) tables in 1.5.2 already.
How did you update? Did you run setup? Setup will add these fields so re-run it.
I did run setup. My previous version was 1.5.4 and it was ok. I did run setup twice and the column was still not there. I ended up adding the column manually in the albums and images tables.
I asked because some install helpers are known to not always perform updates correctly.
This is really weird, setup should add these if not existing. There should be lines to do that in
zp-core/setup/index.php
starting around line 2418. Please look if these are there. If not you perhaps have not updated the files correctly. If your FTP client does not overwrite everything you need to delete it first on updates.Otherwise please review all logs you can find including server php error log about any issues during setup.
The content of the zp-core/setup/index.php file was indeed different. I re-copied the files and it looks ok now. I do not now what happened (I always did the same thing for years and 1.5.4 was working fine). Anyway, thanks very much for you help and quick response!
Good you solved it. Some ftp programs by default update folders with non existing contents if you drop a same named folder on it instead of replacing the whole folder or instead of asking what to do (mine asks for example). We note that specifically on the install/update page therefore as well.