Greetings,
When accessing the pages added to the gallery by Guestbook and ContactForm, I'm encountering the following MySQL error. This does NOT prevent the extensions from working, it's apparently just not able to log something correctly to history. I did try disabling all other plugins for testing purposes.
Guestbook error:
Warning: [mysql error 1265] Data truncated for column 'section' at row 1
INSERT INTO piwigo_history
(
date,
time,
user_id,
IP,
section,
category_id,
image_id,
image_type,
tag_ids
)
VALUES
(
CURRENT_DATE,
CURRENT_TIME,
2,
'99.7.38.75',
'guestbook',
NULL,
NULL,
NULL,
NULL
)
; in F:\piwigo\include\dblayer\functions_mysqli.inc.php on line 830
ContactForm error:
Warning: [mysql error 1265] Data truncated for column 'section' at row 1
INSERT INTO piwigo_history
(
date,
time,
user_id,
IP,
section,
category_id,
image_id,
image_type,
tag_ids
)
VALUES
(
CURRENT_DATE,
CURRENT_TIME,
2,
'99.7.38.75',
'contact',
NULL,
NULL,
NULL,
NULL
)
; in F:\piwigo\include\dblayer\functions_mysqli.inc.php on line 830
Piwigo version: 2.7.0
Operating system: WINNT
PHP: 5.3.28 (Show info) [2014-09-25 18:15:52]
MySQL: 5.6.21 [2014-09-25 18:15:52]
Graphics Library: External ImageMagick 6.8.9-6
Hi lakusfs,
Very interesting, thank you for this feedback. It tells us 2 things:
1) database column piwigo_history.section is an enum and plugins should add their value if they want to log it in history. In maintain* something like:
$history_sections = get_enums(HISTORY_TABLE, 'section'); if (!in_array('guestbook', $history_sections)) { $history_sections[] = 'guestbook'; $query = " ALTER TABLE ".HISTORY_TABLE." CHANGE section section ENUM('".implode("','", $history_sections)."') DEFAULT NULL ;"; pwg_query($query); }
(plugin Additional Pages also do it, with a similar code)
2) MySQL 5.6 seems to send a warning while priori versions did not care : the "section" field remain empty instead of "guestbook"
Offline
Hi all,..
to day i discovered the same on my page.
This only shows up when i am not logged in to piwigo.
Thats why i did not discovered this before i suppose.
Offline