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.

CommentFileSizeAuthor
#1 popup-purl-prefix-1014772.patch509 bytesfoxtrotcharlie

Comments

foxtrotcharlie’s picture

Status: Active » Needs review
StatusFileSize
new509 bytes

Here's the patch which passes the link_path through the url() function so that PURL can act on the link.

mzwyssig’s picture

Patch works here.

Scheepers de Bruin’s picture

Status: Needs review » Patch (to be ported)

Damn... not in latest version - but in git nonetheless

Scheepers de Bruin’s picture

Status: Patch (to be ported) » Closed (fixed)

Fixed in v 3.22

Anonymous’s picture

This also fixed a problem with anchor tags (#) in URLs that are in menus. Thanks!