Steps to replicate:
Install module as normal
Create a 'range' (not 'raw' as in title - oops) Ip address field. Leave as optional (as opposed to 'required')
Attempt to add a node and leave the IP address field blank
If I am correct you will receive an error as follows:
DOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_device_external_ip_start' cannot be null: INSERT INTO {field_data_field_device_external_ip} (entity_type, entity_id, revision_id, bundle, delta, language, field_device_external_ip_start, field_device_external_ip_end) 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, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 243 [:db_insert_placeholder_2] => 245 [:db_insert_placeholder_3] => device_node [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 424 of
\modules\field\modules\field_sql_storage\field_sql_storage.module).
May try and upgrade to latest dev version (once I work out how to upgrade a field module with dependent fields in content types)
Regards
Adam
Comments
Comment #1
anea02 commentedAs an update to this:
It affects the dev release as well
It does not matter whether the widget type is set to 'raw' or 'range'
Regards
Adam
Comment #2
anea02 commentedChecked database - Two fields in the db table concerned (_start, _end) are both set to not allow nulls.
Perhaps I am using a module when I should just create a simple field to hold an ip address???? At this stage (famous last words) I do not require any calculations to be made on this ip address.
Comment #3
hansfn commentedJust for the record: I have seen this problem too.
Comment #4
aidanlis commentedFixed in the latest dev.
Comment #5.0
(not verified) commentedChanged 'raw' to 'range'