Navigation helper bug where domain root path is repeated in page slug

Permalink Browser Info Environment
We had a problem where the path of the root of a mapped domain was repeated in the slug of a page under that domain, so when the navigation helper tried to map it, it would remove it from from the page slug, resulting in a 404.

i.e.
/rogue-path/directory/rogue-path-about-page/

would be changed to

/directory/directory-about-page

We've changed the code in the navigation helper to only do this for the first instance.

In MultipleDomainsNavigationHelper, line 12 onwards

// Found target domain, so let's redirect the user there...
$pos = strpos($url, $p->getCollectionPath());
if ($pos !== false) {
         $url = substr_replace($url, "", $pos, strlen($p->getCollectionPath()));
}

Type: Discussion
Status: Resolved
BinaryFold4
View Replies:
BinaryFold4 replied on at Permalink Reply
BinaryFold4
Link example was slightly wrong

End result would be

/directory-about-page
Mainio replied on at Permalink Reply
Mainio
Thank you very much for this report and particularyly pointing out exactly where the problem was. We tested this and also noticed some other issues in such scenarios where the parent page path shows up multiple times in the full path.

We have went ahead and fixed these issues in the latest version that should be shortly available for download through the Marketplace.

Best regards,
Antti / Mainio

concrete5 Environment Information

Not relevant

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.