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.

  1. Go to Easy Breadcrumb configuration, enable Include the front page as a segment in the breadcrumb, and save.
  2. Create a page, e.g., About us with URL alias about-us.
  3. 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.

CommentFileSizeAuthor
homepage-url-issue-fix.patch1.61 KBadee147

Comments

greg boggs’s picture

Status: Patch (to be ported) » Needs review
sonemonu’s picture

Assigned: adee147 » sonemonu

Will be applied in the next release, coming this weekend on the next week. Thanks.

sonemonu’s picture

Version: 7.x-2.9 » 7.x-2.10
Status: Needs review » Closed (fixed)

Hey 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!

inky@inky3d.com’s picture

Status: Closed (fixed) » Needs review

I'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

sonemonu’s picture

Status: Needs review » Closed (fixed)

Comment #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.

inky@inky3d.com’s picture

Thanks, 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.