When trying to create a case (using the basic case type provided) I always get a "An illegal choice has been detected. Please contact the site administrator." when submitting. Using Drupal 5 and latest copy of Case Tracker

Comments

Lityi’s picture

Do you also use pathauto? :-E

nevets’s picture

In this case, no I am not using pathauto

Lityi’s picture

strange others reported the same error when using pathauto...

nevets’s picture

Found the problem (sorry do not have the tools for generating a patch)

In casetracker_case_form_common(), the else case of this code is causing the problem

  if (count($project_options) > 1) {
    $form['casetracker_project_information'] = array(
      '#type'              => 'fieldset',
      '#title'             => t('Project information'),
      '#weight'            => -10,
      '#collapsible'       => TRUE,
      '#collapsed'         => isset($default_project) ? TRUE : FALSE,
      '#prefix'            => '<div id="project-information">',
      '#suffix'            => '</div>', // no particular reason.
    );
    $form['casetracker_project_information']['pid'] = array(
      '#title'             => t('Project'),
      '#type'              => 'select',
      '#default_value'     => $default_project,
      '#options'           => $project_options,
    );
  }
  else {
    $form['casetracker_project_information']['pid'] = array(
      '#type'              => 'hidden', // default value, or the only the project ID in the project_options array.
      '#default_value'     => isset($default_project) ? $default_project : array_shift(array_keys($project_options)),
      '#options'           => $project_options,
    );
  }

The hidden element should not be using '#options'.

jmiccolis’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Status: Active » Fixed

This form definition issue has been fixed in the Drupal 6 branch, and as this bug doesn't effect my drupal 5 testing I'm setting this to fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.