So on my site we are doing custom_url_rewrite along with path aliases. The issue I am running into is that drupal_get_normal_path() first looks at the alias table THEN call custom_url_rewrite_inbound. Not sure why this would be.
So for instance custom_url_rewrite_inbound erases from the url community/. So all urls are prefixed by community/. community/node/345 works as drupal_get_normal_path() doesn't find a path alias for that, custom_url_rewrite() removes the community, and bam we have a good url (node/345).
But say the node has an alias blog/scotts-new-post. Then the url in the users browser is community/blog/scotts-new-post. drupal_get_normal_path() doesn't find a path alias for community/blog/scotts-new-post (an alias exists for blog/scotts-new-post). Then custom_url_rewrite is called, removing community/ thus resulting in a 'normal path' called blog/scotts-new-post.
In our custom_url_rewrite function we could drupal_lookup_path('source', $path, $path_language) but that would result in querying alias table twice. The first one is a wasted call.
So the solution drupal_get_normal_path() first calls custom_url_rewrite_inbound then drupal_lookup_path('source', $path, $path_language).
| Comment | File | Size | Author |
|---|---|---|---|
| patch16.patch | 841 bytes | Scott Reynolds |
Comments
Comment #1
m3avrck commentedBump, still running this patch.
Comment #2
dave reidWould need to be fixed in HEAD first. Also tagging.
Comment #4
dave reidLet's fix this in #348840: path_alias and custom_url_rewrite_inbound
Comment #5
summit commentedHi, Sorry, but the latest link is a link to exactly this page, so setting this to active again, ok?
Greetings, Martijn