When trying to create a menu item who's path is an alias I get an error and can not submit the form:
"The path 'faculty/tenured' is either invalid or you do not have access to it."

faculty/tenured links to taxonomy/term/2

Looking at menu_valid_path() it seems that the issue is in menu_get_item().

CommentFileSizeAuthor
#1 filename_0.patch3.58 KByasheshb

Comments

yasheshb’s picture

StatusFileSize
new3.58 KB

harking:

hello, i've fixed the code (patch attached) to incorporate url aliases as paths in menu items. the code will work as long
as one does not edit the url alias. the reason being

the path (link_path) determines the router_path for the menu item.

i've added code in the menu.module to check if the menu path is a url alias. if so, it's validated.

the menu path is then given to menu_link_save function in menu.inc where it's router_path is determined.
here again, i'm checking to see if the menu path (link_path) is a valid url alias, if so, i use the
source of the url alias to calculate the router path.

however, if one edit's the url alias - i.e. either changing the source or destination,
then one needs to update the tables for menu_links. this could be implemented with
a hook invoked by the path module.

hence this is a partially working solution, would appreciate feedback from community on
moving further.

rgd.

yashesh

pwolanin’s picture

Status: Active » Needs work

The menu link editing form says that you must enter a Drupal path. Aliases should never be put in this table.

A possible solution would be to look up the alias and save the Drupal path in the DB. This should be done in menu.module, and not touch any code in menu.inc.

webernet’s picture

Status: Needs work » Fixed

Fixed in 6.x -- the alias is converted to the drupal path.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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