I have a Drupal-7.14 install and have an entity with a date field attached to it.
I was only collecting the Year attribute with the option for collecting an end date.
I got the following error message when trying to submit the form:

  • PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2010' for column 'field_student_enrolled_value' at row 1: INSERT INTO {field_data_field_student_enrolled} (entity_type, entity_id, revision_id, bundle, delta, language, field_student_enrolled_value, field_student_enrolled_value2) 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] => profile2 [:db_insert_placeholder_1] => 616 [:db_insert_placeholder_2] => 616 [:db_insert_placeholder_3] => student [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 2010 [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 448 of /home/clinks/domains/partydev.commonnonsense.co.uk/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
    

I tried debugging it and I get the same error with just year and month, but it works fine for year, month and day together.
Curious little error so I thought I'd report it. Anyone get similar?

Comments

kerasai’s picture

Hi yanniboi, what type of database are you using? MySQL?

yanniboi’s picture

yup!

mingis’s picture

Same issue for me on Drupal 7.15 and Date 7.x-2.6