Index: modules/cvslog/cvs.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cvslog/cvs.module,v retrieving revision 1.135 diff -u -p -r1.135 cvs.module --- modules/cvslog/cvs.module 29 Dec 2006 01:25:35 -0000 1.135 +++ modules/cvslog/cvs.module 5 Jan 2007 19:20:20 -0000 @@ -786,9 +786,12 @@ function cvs_alter_project_release_form( if (isset($post_val)) { if (is_numeric($post_val) && !empty($post_val) && db_result(db_query('SELECT COUNT(*) FROM {term_data} WHERE tid = %d AND vid = %d', $post_val, $vid))) { $version->version_api_tid = $post_val; - $index = form_get_option_key($form['taxonomy'][$vid], $post_val); - if ($index !== FALSE) { - $options[$post_val] = $form['taxonomy'][$vid]['#options'][$index]; + $indexes = form_get_options($form['taxonomy'][$vid], $post_val); + $options = array(); + if ($indexes !== FALSE) { + foreach ($indexes as $index) { + $options[] = $form['taxonomy'][$vid]['#options'][$index]; + } $form['taxonomy'][$vid]['#options'] = $options; $form['taxonomy'][$vid]['#default_value'] = $post_val; $needs_api_none = false; @@ -796,7 +799,9 @@ function cvs_alter_project_release_form( } } if ($needs_api_none) { - $form['taxonomy'][$vid]['#options'] = array(0 => t('None')) + $form['taxonomy'][$vid]['#options']; + $none = new stdClass(); + $none->option = array(0 => t('None')); + $form['taxonomy'][$vid]['#options'] = array_merge(array($none), $form['taxonomy'][$vid]['#options']); $form['taxonomy'][$vid]['#default_value'] = 0; // Set required to false so we don't get an error as soon // as we land on the page. We'll re-mark it required in @@ -900,11 +905,16 @@ function cvs_alter_project_release_form( unset($form['version']['num'][$field]); } } + // If we already know the version info, which includes the + // compatibility taxonomy, so rip out all other taxonomy options. if (isset($form['taxonomy'][$vid])) { $tid = $version->version_api_tid; - $index = form_get_option_key($form['taxonomy'][$vid], $tid); - if ($index !== FALSE) { - $options[$tid] = $form['taxonomy'][$vid]['#options'][$index]; + $indexes = form_get_options($form['taxonomy'][$vid], $tid); + if ($indexes !== FALSE) { + $options = array(); + foreach ($indexes as $index) { + $options[] = $form['taxonomy'][$vid]['#options'][$index]; + } $form['taxonomy'][$vid]['#options'] = $options; $form['taxonomy'][$vid]['#default_value'] = $tid; } @@ -925,6 +935,7 @@ function cvs_alter_project_release_form( } } else { + // CVS tag is not yet selected. // Rip out everything else that might be in this form... _cvs_alter_project_release_form_unset_all($form, true); unset($form['taxonomy']); cvs diff: Diffing modules/project cvs diff: Diffing modules/project/po cvs diff: Diffing modules/project/po/ar cvs diff: Diffing modules/project/release Index: modules/project/release/project_release.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project_release.module,v retrieving revision 1.7 diff -u -p -r1.7 project_release.module --- modules/project/release/project_release.module 1 Jan 2007 23:56:12 -0000 1.7 +++ modules/project/release/project_release.module 5 Jan 2007 19:20:21 -0000 @@ -1083,6 +1083,7 @@ function project_release_project_edit_fo function project_release_alter_release_form(&$form) { global $user; $node = $form['#node']; + $tid = $node->version_api_tid; $vid = _project_release_get_api_vid(); if (!project_release_get_api_taxonomy() && isset($form['taxonomy'][$vid])) { unset($form['taxonomy'][$vid]); @@ -1091,7 +1092,6 @@ function project_release_alter_release_f /* if (isset($node->pid)) { $project->nid = $node->pid; - $tid = $node->version_api_tid; } elseif (arg(1) == 'add' && is_numeric(arg(3))) { $project->nid = arg(3); @@ -1103,21 +1103,25 @@ function project_release_alter_release_f // we restrict their options for the compatibility taxonomy. if (isset($tid)) { // If we already have the term, we want to force it to stay. - $options[$tid] = $form['taxonomy'][$vid]['#options'][$tid]; + $indexes = form_get_options($form['taxonomy'][$vid], $tid); + if ($indexes !== FALSE) { + foreach ($indexes as $index) { + $options[] = $form['taxonomy'][$vid]['#options'][$index]; + } + } $form['taxonomy'][$vid]['#default_value'] = $tid; } elseif ($tids = variable_get('project_release_active_compatibility_tids', '')) { // We don't have the term since we're adding a new release. // Restrict to the active terms (if any). - foreach ($tids as $tid) { - $index = form_get_option_key($form['taxonomy'][$vid], $tid); - if ($index !== FALSE) { - $options[$tid] = $form['taxonomy'][$vid]['#options'][$index]; + foreach (array_filter($tids) as $tid) { + $indexes = form_get_options($form['taxonomy'][$vid], $tid); + if ($indexes !== FALSE) { + foreach ($indexes as $index) { + $options[$index] = $form['taxonomy'][$vid]['#options'][$index]; + } } } - if (!empty($options)) { - $options = array(0 => $form['taxonomy'][$vid]['#options'][0]) + $options; - } } if (!empty($options)) { $form['taxonomy'][$vid]['#options'] = $options;