Problem
When Drupal is hosted in a sub-directory, it results in an incorrect front page URL in Easy Breadcrumb.
Steps to Reproduce
On a Drupal application hosted in a sub-directory, e.g., http://www.example.com/exampledir, install and enable Easy Breadcrumb module.
- Go to Easy Breadcrumb configuration, enable Include the front page as a segment in the breadcrumb, and save.
- Create a page, e.g., About us with URL alias about-us.
- Visit that page, e.g., http://www.example.com/exampledir/about-us.
Expected Result
The first segment of Easy Breadcrumb should contain a hyperlink to homepage, e.g., http://www.example.com/exampledir.
Experienced Result
The first segment of Easy Breadcrumb contains a hyperlink to current page, e.g., http://www.example.com/exampledir/about-us.
Proposed resolution
Change easy_breadcrumb.blocks.inc line 28 from
$breadcrumb[] = _easy_breadcrumb_build_item($front_text, $segments_classes, '');
to
$breadcrumb[] = _easy_breadcrumb_build_item($front_text, $segments_classes, '<front>');
Remaining tasks
The attached patch needs to be tested and included in the module.
| Comment | File | Size | Author |
|---|---|---|---|
| homepage-url-issue-fix.patch | 1.61 KB | adee147 |
Comments
Comment #1
greg boggsComment #2
sonemonu commentedWill be applied in the next release, coming this weekend on the next week. Thanks.
Comment #3
sonemonu commentedHey Muhammad,
This should be corrected in the release 7.x-2.10. Could you please confirm this works fine for you in the 7.x-2.10 released on 2014-Jun-13?
Thanks!
Comment #4
inky@inky3d.com commentedI've recently updated 2 sites with the latest 2.11, and one development site - on a sub-domain - does not have links to the parent pages.
I reverted the module back to 2.9 to check that the parents did previously have links (which they did) and updated again, and the links disappeared.
To reproduce:
On a Drupal site in a sub-directory, create a page hierarchy with 3 levels, eg: http://www.example.com/dev/about-us/team
Expected Result
Home > About Us > Team
Experienced Result
Home > About Us > Team
Comment #5
sonemonu commentedComment #4 is not related to this issue, it is related to https://www.drupal.org/node/2291127.
It was corrected, please be sure of adding comments (only) to the related issues.
Comment #6
inky@inky3d.com commentedThanks, the latest version I see is now working.
I see that the issue you pointed me to was actually only created a few hours after my posting here. Sometimes it's hard to tell when to create a new issue rather than comment on an existing one that appears to be related.