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
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

pillarsdotnet - December 19, 2008 - 23:32

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

gmak - January 5, 2009 - 23:21

I am experiencing the same problem using Drupal 6.8.

#3

dragonwize - January 8, 2009 - 06:11
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

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

pillarsdotnet - January 8, 2009 - 08:03

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

dragonwize - January 8, 2009 - 15:41
Status:postponed (maintainer needs more info)» fixed

Ok. Marking as fixed.

#6

System Message - January 22, 2009 - 15:50
Status:fixed» closed

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

#7

dicreat - April 12, 2009 - 14:49
Status:closed» active

I have this error on my Drupal 6.10 installation.

#8

dicreat - April 13, 2009 - 14:01
Status:active» closed

Sorry, in my case problem was be in memcache module.

 
 

Drupal is a registered trademark of Dries Buytaert.