Download & Extend

PDOException on Updating a Webform Report

Project:Webform Report
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello there,

Some days ago I got an error on updating my webform report's name, that's below:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'Relatório: Clientes PF' for column 'wnid' at row 1: UPDATE {webform_report} SET description=:db_update_placeholder_0, wnid=:db_update_placeholder_1, columns=:db_update_placeholder_2, sorton=:db_update_placeholder_3, filters=:db_update_placeholder_4, options=:db_update_placeholder_5 WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => Relatório: Clientes PF [:db_update_placeholder_2] => a:4:{i:0;a:4:{s:3:"cid";i:15;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:1;a:4:{s:3:"cid";i:2;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:2;a:4:{s:3:"cid";i:3;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:3;a:4:{s:3:"cid";i:4;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}} [:db_update_placeholder_3] => a:0:{} [:db_update_placeholder_4] => a:1:{i:0;a:3:{s:5:"field";i:14;s:4:"type";s:1:"7";s:5:"value";s:0:"";}} [:db_update_placeholder_5] => a:5:{s:16:"results_per_page";s:2:"20";s:8:"hide_csv";i:0;s:11:"search_form";i:1;s:6:"layout";s:6:"REPORT";s:8:"php_code";s:0:"";} [:db_condition_placeholder_0] => 3 ) em webform_report_update() (linha 322 de /home/devanide/public_html/webway.eti.br/extranet/sites/all/modules/webform_report/webform_report.module).

So, I fixed that, by editing line 315 from webform_report.module.

Then: 'wnid' => $node->wnid,

Now: 'wnid' => $node->nid,

Worked for me (using Drupal 7.10), did something wrong?
Well, just for next release.

Comments

#1

Assigned to:joao_roccella» Anonymous
Status:fixed» active

Changing status so this issue doesn't go -poof- in a few days.

#2

Hi, when i tried making the change. i lost all the setting for that report. somehow it seems to lost the reference to the webform so just standard fields show up.

#3

That change would not work wnid is the nid of the webform node.

I'm not getting that error on my test rig. I assume y'all are using the latest 7.1-dev version? What version of PHP are you using? Also what database?

Would it be possible to put in a printr() or dpm() (if devel is installed) to display $node at webform_report_update() before the db_update() call?

Thanks!

#4

I have the same problem. Below is the var_dump of the node (from webform_report_update() )

It looks like the webform name is used instead of an numeric id?

<?php
object
(stdClass)[86]
  public
'vid' => string '26' (length=2)
  public
'uid' => string '1' (length=1)
  public
'title' => string 'Overzicht reserveringen' (length=23)
  public
'status' => int 1
 
public 'comment' => string '0' (length=1)
  public
'promote' => int 1
 
public 'sticky' => int 0
 
public 'nid' => string '26' (length=2)
  public
'type' => string 'webform_report' (length=14)
  public
'language' => string 'und' (length=3)
  public
'created' => int 1328271544
 
public 'changed' => int 1328289589
 
public 'tnid' => string '0' (length=1)
  public
'translate' => string '0' (length=1)
  public
'revision_timestamp' => string '1328277719' (length=10)
  public
'revision_uid' => string '1' (length=1)
  public
'wnid' => string 'Booking form' (length=12)
  public
'description' => string '' (length=0)
  public
'columns' =>
    array
     
0 =>
        array
         
'cid' => int 9
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      1
=>
        array
         
'cid' => int 10
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      2
=>
        array
         
'cid' => int 1
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      3
=>
        array
         
'cid' => int 6
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      4
=>
        array
         
'cid' => int 7
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      5
=>
        array
         
'cid' => int 5
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
      6
=>
        array
         
'cid' => int -6
         
'format' => string '' (length=0)
         
'option' => string '' (length=0)
         
'hidden' => int 0
 
public 'filters' =>
    array
     
0 =>
        array
         
'field' => int 10
         
'type' => string '9' (length=1)
         
'value' => string 'today' (length=5)
  public
'sorton' =>
    array
      empty
  public
'options' =>
    array
     
'results_per_page' => string '0' (length=1)
     
'hide_csv' => int 0
     
'search_form' => int 0
     
'layout' => string 'REPORT' (length=6)
     
'php_code' => string '' (length=0)
  public
'rdf_mapping' =>
    array
     
'rdftype' =>
        array
         
0 => string 'sioc:Item' (length=9)
         
1 => string 'foaf:Document' (length=13)
     
'title' =>
        array
         
'predicates' =>
            array
              ...
     
'created' =>
        array
         
'predicates' =>
            array
              ...
         
'datatype' => string 'xsd:dateTime' (length=12)
         
'callback' => string 'date_iso8601' (length=12)
     
'changed' =>
        array
         
'predicates' =>
            array
              ...
         
'datatype' => string 'xsd:dateTime' (length=12)
         
'callback' => string 'date_iso8601' (length=12)
     
'body' =>
        array
         
'predicates' =>
            array
              ...
     
'uid' =>
        array
         
'predicates' =>
            array
              ...
         
'type' => string 'rel' (length=3)
     
'name' =>
        array
         
'predicates' =>
            array
              ...
     
'comment_count' =>
        array
         
'predicates' =>
            array
              ...
         
'datatype' => string 'xsd:integer' (length=11)
     
'last_activity' =>
        array
         
'predicates' =>
            array
              ...
         
'datatype' => string 'xsd:dateTime' (length=12)
         
'callback' => string 'date_iso8601' (length=12)
  public
'name' => string 'admin' (length=5)
  public
'picture' => string '0' (length=1)
  public
'data' => string 'b:0;' (length=4)
  public
'date' => string '2012-02-03 13:19:04 +0100' (length=25)
  public
'revision' => int 0
 
public 'menu' =>
    array
     
'enabled' => int 1
     
'mlid' => string '811' (length=3)
     
'module' => string 'menu' (length=4)
     
'hidden' => string '0' (length=1)
     
'has_children' => string '0' (length=1)
     
'customized' => int 1
     
'options' =>
        array
         
'attributes' =>
            array
              ...
     
'expanded' => string '0' (length=1)
     
'parent_depth_limit' => int 8
     
'link_title' => string 'Overzicht reserveringen' (length=23)
     
'description' => string '' (length=0)
     
'parent' => string 'navigation:0' (length=12)
     
'weight' => string '0' (length=1)
     
'language' => string 'und' (length=3)
     
'plid' => string '0' (length=1)
     
'menu_name' => string 'navigation' (length=10)
  public
'path' =>
    array
     
'alias' => string 'overzicht-reserveringen' (length=23)
     
'pid' => string '4' (length=1)
     
'source' => string 'node/26' (length=7)
     
'language' => string 'und' (length=3)
     
'pathauto' => int 1
 
public 'additional_settings__active_tab' => string 'edit-menu' (length=9)
  public
'submit' => string 'Save' (length=4)
  public
'preview' => string 'Preview' (length=7)
  public
'delete' => string 'Delete' (length=6)
  public
'form_build_id' => string 'form-z56Xx_m9quwKOMNHMZx8uKishPnXXkRGtRBEmCAygHY' (length=48)
  public
'form_token' => string '0otc9DCo69jWfeOkmUJF8FUkXzpsgxbppsTrPjLg-Eo' (length=43)
  public
'form_id' => string 'webform_report_node_form' (length=24)
  public
'op' => string 'Save' (length=4)
  public
'validated' => boolean true
 
public 'original' =>
   
object(stdClass)[95]
      public
'vid' => string '26' (length=2)
      public
'uid' => string '1' (length=1)
      public
'title' => string 'Overzicht reserveringen' (length=23)
      public
'log' => string '' (length=0)
      public
'status' => string '1' (length=1)
      public
'comment' => string '0' (length=1)
      public
'promote' => string '1' (length=1)
      public
'sticky' => string '0' (length=1)
      public
'nid' => string '26' (length=2)
      public
'type' => string 'webform_report' (length=14)
      public
'language' => string 'und' (length=3)
      public
'created' => string '1328271544' (length=10)
      public
'changed' => string '1328277719' (length=10)
      public
'tnid' => string '0' (length=1)
      public
'translate' => string '0' (length=1)
      public
'revision_timestamp' => string '1328277719' (length=10)
      public
'revision_uid' => string '1' (length=1)
      public
'wnid' => string '3' (length=1)
      public
'description' => string '' (length=0)
      public
'columns' =>
        array
         
0 =>
            array
              ...
         
1 =>
            array
              ...
         
2 =>
            array
              ...
         
3 =>
            array
              ...
         
4 =>
            array
              ...
         
5 =>
            array
              ...
         
6 =>
            array
              ...
      public
'filters' =>
        array
         
0 =>
            array
              ...
      public
'sorton' =>
        array
          empty
      public
'options' =>
        array
         
'results_per_page' => string '0' (length=1)
         
'hide_csv' => int 0
         
'search_form' => int 0
         
'layout' => string 'REPORT' (length=6)
         
'php_code' => string '' (length=0)
      public
'rdf_mapping' =>
        array
         
'rdftype' =>
            array
              ...
         
'title' =>
            array
              ...
         
'created' =>
            array
              ...
         
'changed' =>
            array
              ...
         
'body' =>
            array
              ...
         
'uid' =>
            array
              ...
         
'name' =>
            array
              ...
         
'comment_count' =>
            array
              ...
         
'last_activity' =>
            array
              ...
      public
'name' => string 'admin' (length=5)
      public
'picture' => string '0' (length=1)
      public
'data' => string 'b:0;' (length=4)
  public
'is_new' => boolean false
 
public 'timestamp' => int 1328289589

Error
Error message
PDOException
: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'Booking form' for column 'wnid' at row 1: UPDATE {webform_report} SET description=:db_update_placeholder_0, wnid=:db_update_placeholder_1, columns=:db_update_placeholder_2, sorton=:db_update_placeholder_3, filters=:db_update_placeholder_4, options=:db_update_placeholder_5 WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => Booking form [:db_update_placeholder_2] => a:7:{i:0;a:4:{s:3:"cid";i:9;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:1;a:4:{s:3:"cid";i:10;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:2;a:4:{s:3:"cid";i:1;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:3;a:4:{s:3:"cid";i:6;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:4;a:4:{s:3:"cid";i:7;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:5;a:4:{s:3:"cid";i:5;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}i:6;a:4:{s:3:"cid";i:-6;s:6:"format";s:0:"";s:6:"option";s:0:"";s:6:"hidden";i:0;}} [:db_update_placeholder_3] => a:0:{} [:db_update_placeholder_4] => a:1:{i:0;a:3:{s:5:"field";i:10;s:4:"type";s:1:"9";s:5:"value";s:5:"today";}} [:db_update_placeholder_5] => a:5:{s:16:"results_per_page";s:1:"0";s:8:"hide_csv";i:0;s:11:"search_form";i:0;s:6:"layout";s:6:"REPORT";s:8:"php_code";s:0:"";} [:db_condition_placeholder_0] => 26 ) in webform_report_update() (line 323 of /Users/kevin/Sites/no/sites/all/modules/webform_report/webform_report.module).
?>

#5

Also when editing the node, I see the webform name instead of the wid!

#6

I simply removed the wnid from the update function. If it can't be changed there is no point in having it in the update function?

AttachmentSize
webform_report_PDO_update_webform_report.patch 545 bytes

#7

Status:active» fixed

Excellent suggestion - patch has been pushed to repo - Thanks!

#8

Status:fixed» closed (fixed)

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