Problem/Motivation
I'm experiencing issues on my site related to breadcrumbs, and tracked down the issue to your module.
The MailJet module has code which duplicates the last breadcrumb path. I'm guessing the intention is so that the breadcrumbs will display the full path including the current page.
The code is in mailjet.module
/**
* Implements hook_menu_breadcrumb_alter().
*/
function mailjet_menu_breadcrumb_alter(&$active_trail, $item) {
global $base_url;
$active_trail = array_merge(array_slice($active_trail, 0, count($active_trail)), array($active_trail[count($active_trail) - 1]));
}
Unfortunately, this code has a few of issues:
1 ) It does not check if the last path has a title, so empty breadcrumb paths are printed. You can see this if you visit a path like http://example.com/node
2 ) This code interferes with modules that control the display of breadcrumbs such as crumbs. With crumbs module installed, I see the last breadcrumb item twice.
Ultimately, the mailjet module should not be altering breadcrumbs. That behavior is beyond the scope of the module, and there is no necessity by the mailjet module to make such a broad change to an entire website. If webmasters want to see the current page title in the breadcrumb, they can install one of the many other breadcrumb modules.
Proposed resolution
This code should be removed entirely, and a new release should be made ASAP since it has such a wide-sweeping impact across all websites where the MailJet module is installed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mailjet-breadcrumbs-3267904.patch | 652 bytes | hargobind |
Comments
Comment #2
hargobindAttached is a patch which removes the lines.
Comment #3
abrammHi @hargobind,
What you're saying is absolutely reasonable, however I'm afraid there's no active maintainer for D7 versions of the module.
I know the module code may be awful; it seems like originally it was developed by few separate people not even necessary having Drupal knowledge.
We (DevBranch) have picked up module maintenance for D8/D9 versions (and already prepared first working D9 release, currently in alpha) but I don't think we'll be able to maintain D7 as well.
I'll keep this issue open in case someone wants to pick this up.
Comment #4
hargobindGood to know, and thank you for your work in maintaining this module for the future.
I would be willing to maintain the D7 branch. A client of mine uses Mailjet, and I have a patch with a few minor improvements I could add to the code. I'll also try to fix a couple of the D7 issues in the queue. Would you be interested in making me a maintainer? Also, how much is the Mailjet company involved in this module, and are you in touch with them?
Comment #5
abrammD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
Everyone can apply the patch above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!