Cannot delete taxonomy term
pillarsdotnet - December 19, 2008 - 21:28
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | taxonomy.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Attempts to delete a taxonomy term result in two on-screen warning messages:
- Term name field is required.
- Weight field is required.
I've verified this with a newly-created site.
Software versions:
- PHP: 5.2.6
- Drupal: CVS DRUPAL-6 current checkout
- taxonomy.module: CVS DRUPAL-6, Id 1.414.2.5 2008/09/17 12:55:37 goba

#1
After adding a trace call to the top of every function in taxonomy.admin.inc, I discovered that after I click on the submit button of the delete confirmation dialog, the taxonomy_form_term() function is called, with a form_state parameter as follows:
Array
(
[storage] =>
[submitted] =>
[post] => Array
(
[confirm] => 1
[op] => Delete
[form_build_id] => form-fcec7a9e8127a30358412a2706b0cbb1
[form_token] => b1ff3b5cd0959330b178a4b3d6739778
[form_id] => taxonomy_form_term
)
)
The function is looking for a $form_state['confirm_delete'] value which does not exist.
<?php
function taxonomy_form_term(&$form_state, $vocabulary, $edit = array()) {
$edit += array(
'name' => '',
'description' => '',
'tid' => NULL,
'weight' => 0,
);
$parent = array_keys(taxonomy_get_parents($edit['tid']));
$form['#term'] = $edit;
$form['#term']['parent'] = $parent;
$form['#vocabulary'] = (array)$vocabulary;
$form['#vocabulary']['nodes'] = drupal_map_assoc($vocabulary->nodes);;
// Check for confirmation forms.
if (isset($form_state['confirm_delete'])) {
return array_merge($form, taxonomy_term_confirm_delete($form_state, $edit['tid']));
}
?>
Or perhaps another function should be called entirely, and isn't. I dunno. Help anyone?
#2
I am experiencing the same problem using Drupal 6.8.
#3
I can not confirm this in 6.8 on a base install. Deleting a term works. There has to be other factors influencing this issue. Need more info or someone that can reproduce that is willing to debug it.
#4
Sorry -- updated to latest CVS (6.9) and the problem went away.
It it were still happening I'd be willing to debug. When I get down to individual program traces and still can't figure out what's going on I start asking for help.
If you've got any pointers on *how* to debug such a problem, I'd love to hear 'em, just in case I start beating my head against another brick wall. (happens frequently, in fact)
#5
Ok. Marking as fixed.
#6
Automatically closed -- issue fixed for two weeks with no activity.
#7
I have this error on my Drupal 6.10 installation.
#8
Sorry, in my case problem was be in memcache module.