Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
11 Aug 2007 at 04:50 UTC
Updated:
3 Nov 2007 at 17:07 UTC
Jump to comment: Most recent file
Once we had this capability and somewhere it got lost. It's not hard to restore, though... while there, we can add the capability to recognize and store properly if user enters an alias. One minor change in the patch, I made router build a very little bit more understandable by putting $move = FALSE close to $move = TRUE.
This will change the path entered by the user to its aliased version. If this is undesired, I can add drupal_get_normal_path calls to menu module.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | menu_alias_2.patch | 5.77 KB | pwolanin |
| #7 | menu_alias_1.patch | 4.88 KB | chx |
| #5 | menu_alias_0.patch | 4.89 KB | chx |
| #4 | menu_alias.patch | 5 KB | chx |
| #1 | store_aliased_path_0.patch | 1.26 KB | chx |
Comments
Comment #1
chx commentedActually, changing back to normal path would be a loss in functionality because now you can enter an alias and then move the alias to a different source path and the menu link won't change. I removed one unnecessary hunk from the patch.
Comment #2
dman commentedI always liked the idea that I could have a menu or embed link pointed at '/latest-version', '/latest-version' aliased to 'node/77' ... and then next year redirect '/latest-version' to 'node/999'
I always dreaded trying to explain the difference between linking to the node ID and linking to the alias to the content managers, however :)
Comment #3
chx commenteddman, this means you like this patch ... or not?
Comment #4
chx commentedPeter says, aliases have languages. No dice. Let's try this then.
Comment #5
chx commentedKeeping up with HEAD.
Comment #6
pwolanin commentedIt seems like if we are smart about the path aliases, this could be a big boost.
It seems as though if we run _menu_link_translate and the resulting href is the same as the menu_link, then we can be certain that there is no alias. Is this true?
Comment #7
chx commentedpwolanin is right and yesterday I was wrong when we talked, we only need to check $item['to_arg_functions'] because if that's empty _menu_link_map_translate will not do anything (I thought that % can be replaced to current path parts but that only happens with router items mostly for local tasks). Thus I changed the condition and yes paths without aliases are now set up not to check for an alias again.
Comment #8
pwolanin commentedFatal error: Unsupported operand types in /Users/Shared/www/drupal6/includes/common.inc on line 1333
I think there is some logic missing - if we odn't have an alias, nor a dynamic arg we must still generate the href.
Comment #9
pwolanin commentedthe fatal error was because we need to unserialse() the options array before adding elements to it.
So this one works, but still missing the boo and menu module parts
Comment #10
pwolanin commenteddoh. I'm not sure this is worth trying to do here. The new language system makes this impossible to do as a simple join.
see: http://api.drupal.org/api/function/drupal_lookup_path/6
Comment #11
chx commentedNo it does not seem possible. Pity.