With 6.x-1.7 file_attach module throws "An illegal choice has been detected. Please contact the site administrator" error. Reverting my previous installed version (6.x-1.4) and the problem is gone. dblog doesn't give any useful info except the fact that this error is related to form submission state and the illegal choice is the attached file.Hope it makes more sense to someone who can properly debug it.

Comments

charos’s picture

Priority: Normal » Minor

Changing this to minor since pressing "save" again, the node is created normally.

charos’s picture

Issue summary: View changes

Correctly state the reverted version of the module (6.x-1.4) where the issue disappears.

DamienMcKenna’s picture

Version: 6.x-1.7 » 7.x-1.x-dev
Issue summary: View changes

I'm seeing this where it seems the file has already been attached when _form_validate() runs, so the $options list no longer includes the filename that was selected, thus leading to the error.

DamienMcKenna’s picture

Title: An illegal choice has been detected with file_attach » "An illegal choice has been detected"

FYI I'm seeing this with the Video module on D7.

ph7’s picture

Version: 7.x-1.x-dev » 7.x-1.9
Component: Source: Attach (FTP) » Source: Remote URL

I observed the exact same behaviour after uploading a remote image on a content type node. The content type also contains a entity reference field that is filled via an select view. When I try to save the node the "An illegal choice has been detected" error message appears and the data/selection on the entity reference field is cleared. Another hit on the save button stores the node but the data on entity reference field is gone. I have to edit the node again to restore the previous selection on the entity field. I can then save without any problem. So, it kinda works but it's not user friendly.