Under some circumstances the options of th ticket node form are fetched from the cache when the form is submitted. But if the Options have been modified by JavaScript the wrong option values are fetched and the form.inc stops the validation by throwing an error "An illegal choice has been detected"... I already commited some similar issues.

Files: 
CommentFileSizeAuthor
#1 stormticket.stormticket_form.illegal_choice.patch2.15 KBCarsten Müller
FAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 201 exception(es).
[ View ]
stormticket.stormticket_form.illegal_choice.patch1.61 KBCarsten Müller
FAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 201 exception(es).
[ View ]

Comments

Carsten Müller’s picture

StatusFileSize
new2.15 KB
FAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 201 exception(es).
[ View ]

There was something important missing in the patch, here an update

Status:Needs review» Needs work

The last submitted patch, stormticket.stormticket_form.illegal_choice.patch, failed testing.

Carsten Müller’s picture

The patch destroys the upload of attachements because there is a validation in the upload module

// Load the form from the Form API cache.
  if (!($cached_form = form_get_cache($_POST['form_build_id'], $cached_form_state)) || !isset($cached_form['#node']) || !isset($cached_form['attachments'])) {
    form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
    $output = theme('status_messages');
    print drupal_to_js(array('status' => TRUE, 'data' => $output));
    exit();
  }

I'm searching for a new solution.

Carsten Müller’s picture

juliangb’s picture

Title:Patch for stormticket_form()» "An illegal choice has been detected" error

Title change.

juliangb’s picture

Status:Needs work» Closed (won't fix)

This problem is not an issue in the Drupal 7 version (Project Management) due to a different method of generating the dropdowns, and there is no clean fix for the way that this is done in Drupal 6.