I have several Profile2 types that all work perfectly by collecting various field types with the exception of one. Basically I have just discovered that if 'all' the fields to the content type are not used/selected on saving I get an error crash. If all fields are used the profile type is saved without issue. What's strange is that all the profile types were created at the same time in the same manner so I cannot understand why only the one profile type is crashing with this issue (all other content types can have any number of fields selected and saved without issue).
Error
The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'autocreate' for column 'field_job_title_tid' at row 1: INSERT INTO {field_data_field_job_title} (entity_type, entity_id, revision_id, bundle, delta, language, field_job_title_tid) 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] => profile2 [:db_insert_placeholder_1] => 106 [:db_insert_placeholder_2] => 106 [:db_insert_placeholder_3] => my_work_profile [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => autocreate ) in field_sql_storage_field_storage_write() (line 448 of /Applications/MAMP/htdocs/Linode/MRFGR2/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comments
Comment #1
ToursandTales commentedI'm also getting this error message when trying to add a new post of one content type. In particular when I leave some (non-compulsory) fields blank. I can add nodes without all the fields via another content type?!? Where to even begin looking? All help would be appreciated :-)
Comment #2
spessex commentedIn my issue I looked at the error (field) that was causing the problem, deleted the field and then re-added it with all the same information and this sorted it. I think very occasionally when adding fields somethings goes awry in the database which doesn't set the field correctly.
Comment #3
DavidoffC commentedIn my case I had to delete one of taxonomy fields (had two) and everything works fine now.
Comment #4
ToursandTales commentedThanks, I removed a recently added field and that fixed my problem too. Glad it wasn't an existing field I had to delete! Didn't fancy having to go through all the nodes and adding the info again ;-)
Comment #5
JayMN commentedEven quicker: just re-save the field
(if you have access to the field through the UI). I had this problem (same error, different column) with only one field of many imported from Content Profile (D6) into the user entity through CP2P2. Re-saved it in manage fields: edit, settings, and widget type. Interestingly, the widget type couldn't be edited on the admin page in Firefox, but could in IE, so I did all the saves in IE, and then the problem disappeared. And thanks, this thread saved time!
Comment #6
ressaThanks @JayMN I can confirm that re-saving edit, settings, and widget type for the field takes care of this error.
Comment #7
Countzero commentedUnfortunately, re-saving doesn't work for me.
I'm in the same situation, where I upgraded with cp2p2, and everything seems fine except creating new nodes.
Big db, so deleting and recreating the field is not an option.
Does anyone have a clue about what to change in the fields' db info to straighten this ?
Comment #8
damien laguerre commentedJayMN thank you!
I don't really know why, just fields based on taxonomy were broken.
#5 Works fine.
Comment #9
Perseids commented#5 works.
Note that devel is somehow able to create content just fine regardless of this
Comment #10
masher commentedRe-saving the widget as #5 fixed it for me.
Got the error when the auto tagging term reference field was empty on save.
Many thanks
Comment #11
Anonymous (not verified) commentedHi,
#5 fixed the problem for me too.
Many thanks.
Comment #12
junaidpvIt is 2019 already.
We are getting same error and #5 worked!
Thanks!
Comment #13
rickj commentedIf I understand the comments correctly, this looks like a glitch somewhere in core, and is not specific to profile2. It's weird, but I don't think we can do anything here.
Closing.