Closed (fixed)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 May 2006 at 08:41 UTC
Updated:
5 Mar 2010 at 12:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
gregglesCan you describe the problem some more?
Also, I don't see this as critical, so I'm changing the priority to reflect that.
Comment #2
venkat-rk commentedvatavale, the category_pathauto module does this and more. Of course, it has some serious issues right now that need fixing, but once fixed, will work nicely.
Comment #3
gregglesvatavale - thanks for finding this issue. I figured out what you meant and have created the attached patch which I believe achieves what you desire.
Reading http://api.drupal.org/api/4.7/function/menu_get_menu it's pretty clear that visible is the only thing you are supposed to use most of the time. That was the solution here as well.
Comment #4
gregglesForgot to change the status...
Comment #5
Stefan Nagtegaal commentedGo ahead Greggles, commit it to CVS..
Comment #6
gregglescommitted to 4.7 and HEAD
Thanks vatavale and stefan
Comment #7
vatavale commentedthank you greggles for patch, but after it another problem apear. It's look like http://drupal.org/node/75558
I have [menupath][nid].html for default path pattern and only 1.html -- 168.html generated.
Comment #8
vatavale commentedSorry. It's my fault. I forgot make hack for russian language transcoding.
Comment #9
vatavale commentedok. after detailed testing:
after this patch [menupath] works only for categories and containers (category module)
But for page [menupath] return nothing (although breadcrumbs for this pages looks perfect).
Menu item for this pages are disabled (but it did not affect breadcrumbs).
It seems like only if "root" menu item is disabled then pathauto don't must generate aliases for this branch. But "leaf" (last in branch) menu item must not affect generation of aliases.
Comment #10
gregglesvatavale - I'm having a hard time following your last description.
I'm most concerned with this part:
Can you explain in more detail:
1. What the menu path is for the pages that don't seem to be work
2. Which levels in that menupath are enabled/disabled
Something like the following steps to repeat the situation that you have:
1. Use a node filter like [menupath]/[nid]
2. Create nodes root_node child1_node child2_node
3. Create a root menu item root_menu which is enabled and points to root_node
4. Create a menu item child1_menu which is a sub menu of the root_menu and which is disabled and which points to child1_node
5. Create a menu item child2_menu which is a sub menu of the child1_menu and is enabled/disabled and which points to child2_node
6. Bulk update node paths
Expected results (whatever they are)
Actual results (what happened that seemed wrong to you)
Thanks!
Comment #11
vatavale commentedOk. It's easy:
1. Use a node filter like [menupath]_[nid].html
2. Create nodes firstnode secondnode thirdnode
3. Create a root menu item menu1 which is enabled and points to root_node
4. Create a menu item menu2 which is a sub menu of the root_menu and which is enabled and which points to child1_node
5. Create a menu item menu3 which is a sub menu of the child1_menu and is DISABLED and which points to child2_node
6. Bulk update node paths
Expected results:
firstnode: menu1_1.html
secondnode: menu1/menu2_2.html
thirdnode: menu1/menu2/menu3_3.html
Actual results (what happened that seemed wrong to you)
firstnode: menu1_1.html
secondnode: menu1/menu2_2.html
thirdnode: _3.html
Also i don't understand why when menu for thirdnode is disabled breadcrumbs show "home > menu1" but not "home > menu1 > menu2" ? I think it's a menu module bug?
Comment #12
vatavale commentedThere are some errors in previous post.
1. Use a node filter like [menupath]_[nid].html
2. Create nodes firstnode secondnode thirdnode
3. Create a root menu item menu1 which is enabled and points to firstnode
4. Create a menu item menu2 which is a sub menu of the menu1 and which is enabled and which points to secondnode
5. Create a menu item menu3 which is a sub menu of the menu2 and is DISABLED and which points to thirdnode
6. Bulk update node paths
Expected results:
firstnode: menu1_1.html
secondnode: menu1/menu2_2.html
thirdnode: menu1/menu2/menu3_3.html
Actual results (what happened that seemed wrong to you)
firstnode: menu1_1.html
secondnode: menu1/menu2_2.html
thirdnode: _3.html
Also i don't understand why when menu for thirdnode is disabled breadcrumbs show "home > menu1" but not "home > menu1 > menu2" ? I think it's a menu module bug?
Comment #13
gregglesvatavale - thanks for the very detailed explanation of what happened and what should have happened. It makes the job of fixing the problem so much easier!
So, this is an interesting problem and I have an idea on how to fix it. One comment though, on the expected path for the third node:
Expected results:
thirdnode: menu1/menu2/menu3_3.html
I would expect that one to be:
thirdnode: menu1/menu2/_3.html
Because the menu3 part is hidden. However, that's probably not the desired behavior, so here is the statement of the issue that I think we should follow:
When building a menu path, do not include hidden menu items in the path unless the hidden item is the menu for the node itself.
Does that seem reasonable?
Also, I'm setting the status back to "code needs work". And if you find that a patch fixes your problem please don't change the status to "fixed" unless you have committed the code to the CVS repository (something that only Steef and I can do at the moment). Otherwise it is confusing what happened.
Finally - menu/breadcrumb problems are very out of scope for pathauto.
Comment #14
vatavale commentedYes, i think you right: thirdnode must be menu1/menu2/_3.html
Comment #15
dave reidFeature requests are bumped to 7.x-1.x/6.x-2.x now. 6.x-1.x is feature frozen.
Comment #16
dave reidThis code no longer applies to pathauto and would need to be fixed in token.module. Please re-file an issue there if still necessary.
Comment #17
vatavale commentedThank you -- i personally don't need this feature anymore.