Announcement

  •  » Extensions
  •  » Error using Guestbook, ContactForm with 2.7

#1 2014-09-26 01:16:31

lakusfs
Guest

Error using Guestbook, ContactForm with 2.7

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

 

#2 2014-09-26 11:41:13

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

Re: Error using Guestbook, ContactForm with 2.7

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:

Code:

$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"


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#3 2015-11-02 10:39:40

Wortel
Member
2015-11-02
4

Re: Error using Guestbook, ContactForm with 2.7

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

 
  •  » Extensions
  •  » Error using Guestbook, ContactForm with 2.7

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact