Closed (outdated)
Project:
Menu Settings per Content Type
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Feb 2010 at 13:38 UTC
Updated:
13 Jun 2020 at 10:07 UTC
Jump to comment: Most recent
Comments
Comment #1
wim leersThis is not a bug, it's a feature request.
It's likely that that module is simply overriding the menu settings for each node type, and that HS is then overriding it again. Welcome to the wonderful world of hooks :)
Let's move this to the Menu Settings per Content Type module to get some feedback on how it works.
Comment #2
jglynn commentedI'm seeing this problem too. Any chance of getting these two modules to work together?
Comment #3
sos4nt commentedWim is right. Both modules get the menu data from the database to rebuild the menu settings from scratch.
Comment #4
no2e commentedI'd love to see both modules (ctm and hierarchical_select) work together. Any chance?
Comment #5
nullpainter commentedHi guys,
It's quite easy to see why the two don't play ball - in
hook_form_alter()for CTM,$form['menu']['parent']['#options']is set, and in the same for hs_menu,$form['menu']['parent']['#options']is unset ;-)Wim - I'm not proposing for one moment to change hierarchical select as, you rightly say, it's not your problem. However, it would be really useful to expose hooks that allow other modules to play nicely with you if they so desire. Would this be a major undertaking to add hooks at places deemed useful, or am I oversimplifying the issue? It may save you from quite so many 'Module XYZ is broken with hierarchical select' type requests...
For the problem at hand, modifying the behaviour of
hs_menu_hierarchical_select_root_level()initially seems appropriate, however we need the current form in scope to work out the selected CTM menus so it all gets a bit nightmare-ish unless one is prepared to do significant hacking of hierarchical select, which seems to be a really dumb thing to even consider doing.M
Comment #6
nullpainter commentedMy previous comment aside, I have managed with very small effort to get CTM and hierarchical select to play nicely.
However, there is a large caveat - the code is a hack, as it requires modifying the hierarchical select module. I therefore don't recommend it unless you are able to justify to yourself that hacking with module code is fine and that you promise not to bug Wim if it inadvertently breaks anything.
This being said, if you change the following in
hierarchical_select.module:1. From:
function _hierarchical_select_hierarchy_generate($config, $selection, $required, $dropbox = FALSE) {to:
function _hierarchical_select_hierarchy_generate($config, $selection, $required, $dropbox = FALSE, $form = null) {2. From:
$hierarchy = _hierarchical_select_hierarchy_generate($config, $hs_selection, $element['#required'], $dropbox);to:
$hierarchy = _hierarchical_select_hierarchy_generate($config, $hs_selection, $element['#required'], $dropbox, $form);3. From:
to:
and add the following hook in a module (changing 'my_module' to be the name of your module):
then the parent menu items rendered in hierarchical select will be sourced from the array returned by the hook instead of the default list returned in
hs_menu_hierarchical_select_root_level().As per my comments at the start of this message, please consider this a proof of concept rather than a recommended fix. Implementation of formal hooks to be able to tweak this, as per my previous message, would of course be ideal.
M
Comment #7
jabraben commentedSubscribe
Comment #8
izkreny commented+1 for #5.
It's really fascinating how many good and useful menu modules is out there, and how little of them can actually work together. :(
Comment #9
summit commentedSubscribing, greetings, Martijn
Comment #10
vasikemoved to the new branch
Comment #11
Pepper commentedHas this been integrated into the new branch, or is HS still overriding? Unfortunately the fix that was posted isn't good for the current version of HS (6.x)
Comment #12
vasike