I am working on a site where the main page is a sub-section of a larger (non-drupal) website. So I wanted to add the url of the main website as the first breadcrumb item. So I implemented hook_path_breadcrumbs_view_alter() and successfully added the a new breadcrumb item to the front of every trail.
However, the module kept rewriting my url. I did some digging and found the issue was at line 354 of path_breadcrumbs.module. So I hacked a quick solution that changes $href = '';
to $href = $matches[1];
on line 355. So I guess I am curious what cases you are trying to catch with this if statement:
// Means that this is href to the frontpage.
if (drupal_strlen($base_string) > drupal_strlen($matches[1])) {
Are you trying to catch cases where people hardcode example.com as the front page url, instead of using <front>
?
So I guess if you could clarify what you are trying to catch, then I can put together a quick patch to still catch those situation, while allowing situations like mine to pass through un-altered.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2066223-path_breadcrumbs_test_export.txt | 855 bytes | kalabro |
Comments
Comment #1
kalabroHello, @adamzimmermann!
As I know external URLs are not working correctly if you use PB render function for breadcrumbs. We will fix it soon.
It is because PB parses any breadcrumbs (from other modules for example) if setting “Use module breadcrumbs render function” is enabled.
Comment #2
kalabroNow this statement replaced: http://drupalcode.org/project/path_breadcrumbs.git/commitdiff/152afe6
@Spleshka, could you please explain why it was used initially?
Comment #3
kalabroLet's ask him.
Comment #4
SpleshkaHeh, unfotrunately, I don't remember the exact reason. I used to spend a lot of time debugging this and found a way of solving several issues with such condition. Maybe it help to deal with the cases when drupal located in subfolder. Or maybe for subdomains. I really can't tell you exactly.
So if you want to put this instead, please test all cases with different $base_url and different breadcrumbs. Note that administrative and custom breadcrumbs are build differently, so please check this too.
Comment #5
kalabroOk, let's test it more carefully.
Comment #6
kalabroSo, we need manual tests on latest HEAD in these cases:
In each case we have to:
Any help!
Comment #7
kalabroRelated: #2101773: Language Prefix Doubles + Path Breadcrumb
Comment #8
kalabroProblem from #2101773: Language Prefix Doubles + Path Breadcrumb should be fixed now: http://drupalcode.org/project/path_breadcrumbs.git/commitdiff/a4bb994
We still need testing as described in #6.
Comment #9
kalabroAfter deep testing I have prepared overall commit for this issue: http://drupalcode.org/project/path_breadcrumbs.git/commitdiff/21790cd
Comment #10
adamzimmermann CreditAttribution: adamzimmermann commented@kalabro Thank you so much for looking into this and fixing it. I tried this out locally and it worked perfectly.
Comment #11
kalabroNow in 7.x-3.0-beta6 release!