I am using PURL on a site which uses the popup module's menu blocks, but links that should display with a path prefix, don't.
Looking at the code, it appears that a popup menu item's links are not created using the l or url functions, which would enable PURL to act on the links (it uses custom_url_rewrite_outbound to modify them, based on information provided in the $options array). So if we create the link paths using the url function and pass $item['link']['localized_options'] as the $options parameter, in processing.inc, the path prefixes are placed in front of the links (line 157):
$link_path = url(str_replace('%', $user->uid, $item['link']['link_path']), $item['link']['localized_options']);
I don't know the module well enough to know if this is the best place for it, but it works for my purposes.
I'll create a patch shortly.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | popup-purl-prefix-1014772.patch | 509 bytes | foxtrotcharlie |
Comments
Comment #1
foxtrotcharlie commentedHere's the patch which passes the link_path through the url() function so that PURL can act on the link.
Comment #2
mzwyssig commentedPatch works here.
Comment #3
Scheepers de Bruin commentedDamn... not in latest version - but in git nonetheless
Comment #4
Scheepers de Bruin commentedFixed in v 3.22
Comment #5
Anonymous (not verified) commentedThis also fixed a problem with anchor tags (#) in URLs that are in menus. Thanks!