PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'global' at row 1: INSERT INTO {flags} (content_type, name, title, global, options) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => abuse_node [:db_insert_placeholder_2] => Node Abuse [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => a:16:{s:10:"flag_short";s:17:"Flag as offensive";s:9:"flag_long";s:31:"Flag this content as offensive.";s:12:"flag_message";s:0:"";s:12:"unflag_short";s:21:"Flag as non-offensive";s:11:"unflag_long";s:35:"Flag this content as non-offensive.";s:14:"unflag_message";s:0:"";s:18:"unflag_denied_text";s:0:"";s:9:"link_type";s:7:"confirm";s:5:"roles";a:2:{s:4:"flag";a:1:{i:0;s:1:"2";}s:6:"unflag";a:1:{i:0;s:1:"2";}}s:17:"flag_confirmation";s:56:"Are you sure you want to flag this content as offensive?";s:19:"unflag_confirmation";s:60:"Are you sure you want to flag this content as non-offensive?";s:12:"show_on_page";i:1;s:14:"show_on_teaser";i:0;s:12:"show_on_form";i:0;s:13:"access_author";s:0:"";s:4:"i18n";i:0;} ) in flag_flag->insert() (line 1011 of /sites/all/modules/flag/flag.inc).

CommentFileSizeAuthor
#5 1013062_flag_abuse_global.patch671 bytesebeyrent
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sirkitree’s picture

I actually ran into this as well in my testing of Flag Friend - the problem there was that the exported flag needs converted, and then in the export 'global' => FALSE needs changed to 'global' => 0. If you do these changes and re-export the flag and provide a patch I will gladly commit it.

funature’s picture

sorry, i don't understand.

bjones_y’s picture

just installed the abuse flage module. I get the same - I can not enable the abuse flags

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'global' at row 1: INSERT INTO {flags} (content_type, name, title, global, options) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => user [:db_insert_placeholder_1] => abuse_user [:db_insert_placeholder_2] => User Abuse [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => a:13:{s:10:"flag_short";s:11:"Report User";s:9:"flag_long";s:30:"Report this user as offensive.";s:12:"flag_message";s:0:"";s:12:"unflag_short";s:13:"Remove Report";s:11:"unflag_long";s:35:"Remove your report about this user.";s:14:"unflag_message";s:0:"";s:18:"unflag_denied_text";s:0:"";s:9:"link_type";s:7:"confirm";s:5:"roles";a:2:{s:4:"flag";a:1:{i:0;s:1:"2";}s:6:"unflag";a:1:{i:0;s:1:"2";}}s:17:"flag_confirmation";s:55:"Are you sure you want to report this user as offensive?";s:19:"unflag_confirmation";s:57:"Are you sure you want to remove your report of this user?";s:15:"show_on_profile";i:1;s:10:"access_uid";s:0:"";} ) in flag_flag->insert() (line 1014 of /home/judgetrk/public_html/sites/all/modules/flag/flag.inc).

four6three’s picture

The global option is not available in the abuse flags. To handle for this I've updated modules/flag/flag.inc ln 1006 to read $this->global = ($this->global == "") ? 0: $this->global; Please update your module to include a default value.

ebeyrent’s picture

Shouldn't this module pass the $global option as 0? What worked for me was to edit includes/flag_abuse.flag_default.inc and change the global option from FALSE to 0. Once I did that, I was able to enable the flags.

HnLn’s picture

sub and patch from #5 did the trick for me

steve.klingele’s picture

The patch in #5 doesn't fix the the error when enabling abuse_user. The same change to the global option in the abuse_user_flags function is needed.

sirkitree’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.