Hierarchical Select modules should set module weight to 1
Davy Van Den Bremt - July 21, 2008 - 11:41
| Project: | Hierarchical Select |
| Version: | 5.x-3.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Wim Leers |
| Status: | closed |
Description
Attached is a patch for adding the hs widget to the Parent item select box under the menu settings field set in the node/add en node/x/edit pages.
The code is very minimal as all hs specific functionality was already in place for the menu administration section.
This one is very important for me as I regularly work on sites with big menu trees. Making hs work there would be great.
| Attachment | Size |
|---|---|
| hs_menu.module.original | 2.09 KB |

#1
Sorry, the one above is not the patch but the original file.
Find attach the correct patch.
#2
Hah, great, seems I missed a spot :)
However, what is that db query for? I *really* doubt you need it, and if you do need it, it needs some comments. Also, the doxygen for your helper function is missing.
#3
True, I created the first patch in a hurry and didn't think about it thorougly. This one should be better now.
#4
Please create proper patches (using cvs diff) next time.
Now you're not using your helper function. And the documentation for it is still missing :)
#5
Ok, sorry. Left that function is. Is removed now, so no need for docs.
Should be fine now.
#6
*Still* no CVS patch. I see you're a Drupal developer, so you sure must know that only CVS patches are used in the Drupal issue queues…
And the helper function was *good*, it prevented duplicate code. :)
#7
Sorry, I'm not fully into CVS ;)
This one should work?
The helper is now out since there is some difference between the two ('menu' index + no 'params').
#8
Actually… that doesn't change the fact that you should still have a helper function, you can simply pass a parameter to cope with the difference.
Patch attached for illustration. This patch also has been committed.
#9
Automatically closed -- issue fixed for two weeks with no activity.
#10
I had to adjust the module weights before this would work for me.
Set Hierarchical Select Menu to 1 and Hierarchical Select to 2.
Otherwise the menu module hasn't put its fieldset in the form yet.
#11
HS Menu doesn't work if it has weight 0? Could you triple-check that for me? I've always used it with weight 0 without problems!
HS should have a higher weight than HS Menu, that's true.
#12
The reason I needed Hierarchical Select Menu to be heavier than Menu was because I had installed Hierarchical Select in 'modules', as opposed to 'sites/all/modules'.
You can see in this function that hooks are triggered in filename order when the weight is the same:
http://api.drupal.org/api/function/module_list/5
Hierarchical Select Menu should ensure that it is always called after Menu.
#13
I see. Good to know :)
However, I disagree. Contributed modules such as HS Menu should never be installed in the modules directory, since it interferes with upgradability. If it's because you're creating an install profile, I can understand.
Because of that latter (valid) use case, I will add .install files for all included HS modules.
Also, I will add auto-correction of module weight soon, see this issue: http://drupal.org/node/296488.
#14