Hi,
i created a field and i clicked the unique option for that field so that the user may not enter the same value once some particular value has be entered in that field. but if the user tries to enter the same value it leads to error.
"PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 4: WHERE (nid = '1') AND (cid = '1') AND (sid <> '') AND (data... ^: SELECT webform_submitted_data.sid AS sid FROM {webform_submitted_data} webform_submitted_data WHERE (nid = :db_condition_placeholder_0) AND (cid = :db_condition_placeholder_1) AND (sid <> :db_condition_placeholder_2) AND (data = :db_condition_placeholder_3) LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => [:db_condition_placeholder_3] => dfd ) in webform_validate_unique() (line 1067 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\sites\all\modules\webform\includes\webform.components.inc)."
i am getting this error if i use unique option. i am using postgres database. please give valuable suggestion to remove this error..
thanks in advance.
Comments
Comment #1
gopisundar commentedComment #2
quicksketchThanks for the report. I'll see if I can confirm this problem next time I'm working on Webform. Does it make a difference if you're a logged-out user or a logged-in one? Or does it happen either way?
Comment #3
gopisundar commentedIt happens either way. even i tried to give unique option in database.. i got the same error.
Comment #4
gopisundar commented@quicksketch
Any idea regarding this?
Comment #5
quicksketchNo, I haven't been able to look at this yet.
Comment #6
quicksketchI haven't been able to reproduce this problem. I tried with both an e-mail field and a new number component. Both work just fine with the proper error messages:
Are you sure you're running the latest 3.x code? Or does this only occur with a 3.15 installation? Maybe the soon to be released 3.16 will fix this, as I can't see what would cause such a problem in the current code.
Comment #7
quicksketchActually looks like (if you're using PostGres) this is the same as #1216784: webform_validate_unique() throws PDO error when using PostGres. Let's move over there.