On /taxonomy/term/x/edit in the fieldset relations, the hierarchical select widget has a label_0 value by default, in addition to the <root>.
<select>
<option class=" level-label" selected="selected" value="label_0"></option>
<option class="has-no-children" value="0"><root></option>
<option class="has-no-children" value="1">Activités</option>
</select>
If the form is submitted with the default value then the row is deleted from the {taxonomy_hierarchy} table and the term no longer appears in the admin/structure/taxonomy/vocabname listing page.
Solution is probably to ensure that the widget does not have a label_0 value, but instead defaults to <root>
Comments
Comment #1
matslats commentedIn alpha 5, the field is required, which certainly helps, but isn't very user friendly.
Comment #2
invisibleink commentedI changed one function on line 184 to taxonomy_get_parents_all
My first attempt at rolling a patch...
Comment #3
invisibleink commentedApologies,
on reviewing I see that this is not the fix....only works when the only parent is the root.
Comment #4
invisibleink commentedThink I got it this time...
Went with drupal_map_assoc to have the proper return value for the form.
Comment #5
invisibleink commentedThird try...this might be the charm.
Changed from isset to !empty.
Sorry for the first errors.
Comment #6
poukram commentedHello,
thanks for this patch, the bug is solved for me now, but I have not tested all the features of this module to make sure everything was ok.
Comment #7
slybud commented+1 for me : we had this term editing annoying bug on a new D7 site about to be released and this patch solved the problem.
So passing it rtbc
Comment #8
pieterdcI agree with slybud.
Comment #9
kristiaanvandeneynde+1 patch works for me.
Comment #10
rwilson0429 commentedThanks. Patch seems to work for me too.
Comment #11
skizzo commentedpatch does not apply for me, after having applied older patches:
2 Nov: node_submit-1272538-2.patch
9-Dic: null_term_load_check-1331812-4.patch
30 Jan: hs_taxonomy-zero_parent-1286272_1.patch
Comment #12
diegohermes commented+1 patch works for me against alpha 5
Comment #13
skizzo commentedPatch does not apply against latest dev. Changed status to "needs work".
Comment #14
kristiaanvandeneyndeThat's because it was (or is supposedly, haven't tested) fixed in dev.
See #1286272: Taxonomy term 'Parents' field does not recognize '0' to mean '<root>' and commit f6a6292
Comment #15
kristiaanvandeneyndeComment #15.0
kristiaanvandeneyndechanging the html so it shows code instead of attempting to render it