By dalegrebey on
I have an image field in my event content-type. Everytime (for this content type only) I add an Image, it gives errors "An illegal choice has been detected. Please contact the site administrator." This the default image field that is in Drupal 7 core.
Ideas? I deleted it and re-added it. For the first event it did not error, for the second one, it did.
Comments
Watchdog states this: Illegal
Watchdog states this: Illegal choice %choice in %name element.
After disabling Webform (the
After disabling Webform (the most recent module I had installed) When I try to upload an image, I receive this error in a status window:
-------------------------------------------------------------------------
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/field_flyer/und/0/form-SvBgSGBwhDK665_3dHb0DzSVRh-439x-ABtLk0WEMZY
StatusText: n/a
ResponseText:
Error
Error message
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://flyer-pride-in-concert.jpg' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp) 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] => 1
[:db_insert_placeholder_1] => flyer-pride-in-concert.jpg
[:db_insert_placeholder_2] => public://flyer-pride-in-concert.jpg
[:db_insert_placeholder_3] => image/jpeg
[:db_insert_placeholder_4] => 56754
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1305579330
)
in drupal_write_record() (line 6776 of C:\wamp\www\comeoutwithpride\includes\common.inc).
The website encountered an unexpected error. Please try again later.
ReadyState: undefined
This turned out to be an
This turned out to be an error with one of my checkbox fields. I deleted and recreated and it seems to have fixed it.
Due to Ajax form validation
When we upload an image the ajax form validation is done. So it validates for the entire form and if you have some required select list or radio after this image field which is not filled yet will cause the same error.
Now you are smart enough. You can ether move those fields up or declare some default value.