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">&lt;root&gt;</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

matslats’s picture

In alpha 5, the field is required, which certainly helps, but isn't very user friendly.

invisibleink’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

I changed one function on line 184 to taxonomy_get_parents_all

My first attempt at rolling a patch...

invisibleink’s picture

Apologies,
on reviewing I see that this is not the fix....only works when the only parent is the root.

invisibleink’s picture

Think I got it this time...
Went with drupal_map_assoc to have the proper return value for the form.

invisibleink’s picture

Third try...this might be the charm.
Changed from isset to !empty.

Sorry for the first errors.

poukram’s picture

Hello,

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.

slybud’s picture

Status: Needs review » Reviewed & tested by the community

+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

pieterdc’s picture

I agree with slybud.

kristiaanvandeneynde’s picture

+1 patch works for me.

rwilson0429’s picture

Thanks. Patch seems to work for me too.

skizzo’s picture

patch 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

diegohermes’s picture

+1 patch works for me against alpha 5

skizzo’s picture

Status: Reviewed & tested by the community » Needs work

Patch does not apply against latest dev. Changed status to "needs work".

kristiaanvandeneynde’s picture

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

kristiaanvandeneynde’s picture

Status: Needs work » Closed (duplicate)
kristiaanvandeneynde’s picture

Issue summary: View changes

changing the html so it shows code instead of attempting to render it