Hi.
I used the iban field and the validation is good, but when the data is saved, i receive the following mysql error message:
'PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_bank_account_iban_field' at row 1'.
I see in depth and i find the reason of the problem. The max length that is allowed for the field is 22, but there exists more lengths available. I solved it changing the max length allowed.
In addition, i added a hook_update for update the existing instances of the field, in order to add that length.
Comments
Comment #1
omarlopesinoComment #2
omarlopesinoOne thing i forgot to say: i found the max length in the module's file 'iban_field.csv'.
Comment #3
omarlopesinoComment #4
espurnesI tested the module 7.x-1.0 (at simplytest.me) and I've got the same ERROR.
Using the patch #3 solved the problem.
Thank you mistermoper.
Error I've got:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_iban2_iban_field' at row 1: INSERT INTO {field_data_field_iban2} (entity_type, entity_id, revision_id, bundle, delta, language, field_iban2_iban_field) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => 2 [:db_insert_placeholder_3] => page [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ES1020903200500041045040 ) in field_sql_storage_field_storage_write() (line 494 of /home/sc6c4971efc9fb7c/www/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #5
strakkie commentedHi mistermoper,
Thanks a lot for the work you put into this. I have tested the patch included in #3 and will commit these changes in version 1.1 of the module.
Comment #6
strakkie commentedWrong status selected.
Comment #7
strakkie commentedFixed in 1.1 release.