Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1. create taxonomy vocabulary, add at least one term there
2. create taxonomy term named 0 (just number zero). it works.
3. change the weight of this term and save form on admin/content/taxonomy/[vid] (using AHAH drag&drop) => term named 0 not there any more.
Comments
Comment #1
eiland CreditAttribution: eiland commentedI confirm this bug.
Comment #2
eiland CreditAttribution: eiland commentedAn obvious workaround is to
UPDATE `db`.`term_data` SET `name` = '0' WHERE `term_data`.`tid` = [tid];
but im not sure if that will be very resilient if you for example change the order of terms, and the deleting mechanism comes in force.
Dont forget to update the url alias too.
Comment #3
kmajzlik CreditAttribution: kmajzlik commentedChanging order of terms deletes term named '0' too. User can't do anything at DB!
Comment #4
eiland CreditAttribution: eiland commentedrandom exstinguishing a term seems like a big bug to me > upscaling.
Comment #5
joachim CreditAttribution: joachim commentedThis works ok on D7 -- this is a D6 only bug, which is one thing at least :)
Comment #6
bdsl CreditAttribution: bdsl commentedComment #7
joachim CreditAttribution: joachim commentedPlease review the meaning of the Status values -- 'needs work' means there is a patch, and there isn't.
Comment #8
bdsl CreditAttribution: bdsl commentedThanks, have reviewed the meaning of the status values, I see that I got it wrong there. I thought 'needs work' meant it had been confirmed that there is something that could do with being fixed in the project.
Comment #9
valthebaldComment #10
dibyendu4all CreditAttribution: dibyendu4all commentedYes the same problem i have also faced.
I have changed the code for taxonomy.module file:
Under
function taxonomy_save_term(&$form_values) {
please find the line: if (!empty($form_values['tid']) && $form_values['name']) {
changed the code from
if (!empty($form_values['tid']) && $form_values['name']) {
to
if (!empty($form_values['tid']) && isset($form_values['name'])) {
The above solution solved my problem.
Comment #11
lyricnz CreditAttribution: lyricnz commentedThere are several bugs in Drupal where it assumes that empty() returns TRUE only for null or '' (empty string). However several other things also return TRUE - see http://php.net/empty
"" (an empty string)
0 (0 as an integer)
0.0 (0 as a float)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)
$var; (a variable declared, but without a value)
I believe I did an audit of the code for this several years ago, in a d.o issue, but it hasn't progressed since then.