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.

AttachmentSize
hs_menu.module.original2.09 KB

#1

Davy Van Den Bremt - July 21, 2008 - 11:42

Sorry, the one above is not the patch but the original file.

Find attach the correct patch.

AttachmentSize
hs_menu.module.patch2.09 KB

#2

Wim Leers - July 21, 2008 - 16:09
Status:patch (code needs review)» patch (code needs work)

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

Davy Van Den Bremt - July 21, 2008 - 16:52
Status:patch (code needs work)» patch (code needs review)

True, I created the first patch in a hurry and didn't think about it thorougly. This one should be better now.

AttachmentSize
hs_menu.module.patch1.63 KB

#4

Wim Leers - July 21, 2008 - 17:53
Status:patch (code needs review)» patch (code needs work)

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

Davy Van Den Bremt - July 21, 2008 - 18:16

Ok, sorry. Left that function is. Is removed now, so no need for docs.

Should be fine now.

AttachmentSize
hs_menu.module.patch899 bytes

#6

Wim Leers - July 21, 2008 - 18:32

*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

Davy Van Den Bremt - July 21, 2008 - 18:53

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').

AttachmentSize
hs_menu.module.patch1.12 KB

#8

Wim Leers - July 26, 2008 - 10:41
Title:Hierarchical select for menu parent item on node edit/add forms» Hierarchical Select for menu parent item on node edit/add forms
Status:patch (code needs work)» fixed

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.

AttachmentSize
285246.patch1.88 KB

#9

Anonymous (not verified) - August 9, 2008 - 10:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#10

jbrown - August 18, 2008 - 16:01
Status:closed» active

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

Wim Leers - August 18, 2008 - 22:49

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

jbrown - August 19, 2008 - 11:54

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

Wim Leers - August 19, 2008 - 13:12
Title:Hierarchical Select for menu parent item on node edit/add forms» Hierarchical Select modules should set module weight to 1
Priority:normal» minor
Assigned to:Anonymous» Wim Leers

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

Wim Leers - August 27, 2008 - 13:08
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.