Closed (fixed)
Project:
Hierarchical Select
Version:
7.x-3.x-dev
Component:
Code - Taxonomy
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2011 at 12:24 UTC
Updated:
22 May 2012 at 13:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rajatgusain commented@ kervi
This module works properly so no need to uninstall is just download most updated release, and try to add the parent.
It works fine for me.
rajat gusain
Comment #2
dgastudio commentedyou are right Rajat. It was problem of Metatag module.
sorry.
Comment #3
brianV commentedThis is still an active bug.
When you edit a term that has no parent, you cannot save it without the HS widget causing field validation to fail.
It appears that the problem is that a 'parent' value for a term with no parent is '0'. The HS widget doesn't appear to understand that '' should be pre-selected in this case.
In order to save the term, you need to re-select '' in the HS dialogue, click 'add', then click 'Save'.
Comment #4
brianV commentedAttached, please find a patch that should resolve this issue.
The following snippet is what is used to determine the default value for the parent field in hs_taxonomy_form_taxonomy_form_term_alter():
However, if a term does not have parents, taxonomy_get_parents() returns an empty array. Because of this, so does the call to array_keys(). However, in order to make the '' term show by default, we need to specify array(0) as the default rather than an empty array.
The attached patch checks if $parent is an empty array, and uses the expected default value instead.
Comment #5
rajatgusain commentedI was also working on the same bug.
And created a patch please find.
Comment #6
brianV commentedSame solution, but the one in #5 is likely a little cleaner.
Comment #7
jaymallison commentedTested patch from post #5 on my install. Works great. This bug has been driving me crazy for the past couple days. Finally decided to check the queue, yay no more adding root each time I want to edit a term.
I'm marking this RTBC.
Comment #8
rajatgusain commentedthanks jaymallison..
Comment #9
pheraph commented#5 fixes this problem for me, too. Thx rajatgusain.
Comment #10
schmidtk commented#5 also worked for me. Thanks rajatgusain
Comment #11
amogiz commentedI applied the patch. It seems to work but …
Now it duplicates the node : when creating anew node, creating a new item in HS, duplicates the nodes !!!
I had to stop my website cause my clients were furious … Any help wound be really welcome.
Comment #12
jedihe commented@amogiz: I think your problem is the one described at #1293166: Whole node form is saved instead of widget form, possible data loss
I also confirm that #5 corrected the problem for me.
Comment #13
Brandonian commentedRerolled patch #5. Seems to work for us.
Comment #14
serge86 commented#5 fixed the problem for me. Thank you!
Comment #15
klaasvw commented#13 Fixes the issue for me.
Also setting this back to dev.
Comment #16
wim leersThanks! Committed #13, which is in fact #5, so credited @rajatgusain. Sorry for the massive delay in committing this very much needed bugfix.
Commit: http://drupalcode.org/project/hierarchical_select.git/commit/f6a6292
Comment #17
Rontero commented#13 solves some of the problems. Here is one more.
My setup: drupal 7.12 (clean) with HS 7.x-3.x-dev (2012-Apr-19).
First screen shows my sample dictionary.
As you can see I have Shower term placed inside Bathroom term. Let's say I would like to change it. Now I want Shower term to appear as a child of Kitchen term. Well, I hit edit and scroll down to the relations section. Pic no. 2 shows the current setup. Since I don't want my term to appear inside Bathroom any more, I hit remove and that's the part when somethings goes wrong (as shown in last screen). I get this "Parents field is required." every time I select level with HS widget. It keeps showing until you select your final destination and hit add.
Comment #18
rajatgusain commentedThanks Wim Leers !!!
Comment #19
martins.bertins commented#17 In this case there is nothing wrong with HS.
The message is shown because the form is being validated on each ajax event and as you have removed the parent value the field is empty until you add a new value. The validation function is in core and has no conditions when it should be done and when shouldn't.
Comment #20
wim leers#17: you have to select
"<root>":)Comment #22
charubachi commented#5 patch works but there we are removing the condition for valid term tid.
while deleting a term it throws an error.