Posted by pillarsdotnet on December 19, 2008 at 9:28pm
Jump to:
| Project: | Drupal core |
| Version: | 6.14 |
| Component: | taxonomy.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
Comments
#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.
#9
Same problem here
Running 6.14
http://drupal.org/node/646028
I don't find any way to get this working again.
Any suggestion?
#10
More info:
1) about the environment
I have 6 web sites on the same Drupal install, separate databases
- 4 sites fail at deleting terms
- 2 sites are working fine. One of these site has all possible modules enabled (50+ as I use it to perform module updates checking)
- I tried to disable all modules but the only necessary to handle taxonomy : no change
- Cache is disabled
=> this does not look like a database or modules incompatibility problem.
2) Check: indirect term deletion
Deleting a vocabulary correctly deletes all its terms.
Deleting a Forum correctly deletes the corresponding term
=> the problem is not in the deletion function, but in the deletion manual handling
3) Check different browsers
Same behaviour in Chrome, IE8 and Firefox 3.5.5
4) Behavior clarification
When pressing "Delete" on the confirmation page "Are you sure you want to delete the term xxxi?:"
- Redirection to the Edit page for that term
- All fields blanked out
- "Term name" and "Weight" fields are starred and highlighted in red
- Red message on the top :
* Term name field is required.
* Weight field is required.
It looks like the "delete" action is replaced by a "save" action of the term after erasing its information
I still can't see any reason why I would be the only one affected unless:
- it is a new problem in D6.14 and nobody actively using taxonomy was still hit by it.
- or a ghost is haunting in my server
I would very appreciate any help and suggestion to sort this out
#11
Found the problem:
Cacherouter was disabled, but its settings were left in settings.php.
Commenting them solved the issue
#12
Great and very clear post #10 describes the problem, thanks jvieille!
It's as jvieille said, the system deletes the term data then tries to save it. My categories (taxonomy terms) all have images, and I get this problem when deleting terms. I'm not using taxonomy_image, the taxonomy image fields are provided by ubercart/uc_catalog. I can bypass the delete problem if I first remove the category image (and save), then delete the term. Two seperate steps.
Actually this mostly works, but not always. I had one term with no image that had the same problem with deleting. In this case I first saved the term (with no changes), then I could delete the term. Perhaps these terms are not fully entered in the database since an upgrade or import? It seems these terms need to go though a save cycle before they can be deleted properly.