Closed (fixed)
Project:
Easy Breadcrumb
Version:
8.x-1.12
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2019 at 15:14 UTC
Updated:
30 Jan 2020 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
leaf-node commentedI should note that the home page is a basic page with `/` as the URL path.
Comment #3
greg boggsHrm, try clearing the cache after switching themes. Easy Breadcrumb has code to expire the cache when things change, but Bootstrap does not.
Comment #4
leaf-node commentedI tried setting Bartik as the theme, enabling the Easy Breadcrumb option mentioned above, and clearing the Drupal cache, but the home breadcrumb remained.
The root node for my site is a 'Basic Page' with its URL set to '/'. Note that I also have the 'Include the front page as a segment in the breadcrumb' option enabled, and 'Display the front page segment on the front page' disabled.
I'm happy to show a breadcrumb on the main page, so this issue isn't super important for me.
Thanks! : )
Comment #5
greg boggsHave you set a value for the front page crumb to Home or some other string? If you leave that field blank, that's the only thing I can think of. Here's the code in question
Comment #6
leaf-node commentedI set the home page string to a non-empty value.
Comment #7
greg boggsDid that work?
Comment #8
leaf-node commentedOh, sorry for the confusion. I already have a non-empty string enabled, but the breadcrumb still shows up on the main page.
Comment #9
greg boggsI'm out of ideas on where the home crumb could be coming from!
Comment #10
greg boggsAre you able to replicate the issue on Simply Test me?
https://simplytest.me/
Comment #11
junkunczThat's pretty weird.
I started to debug it locally and my first conclusion is: it only happens if the frontpage global site setting is set to simply"/"
If I change to any other path then everything is working as expected.
I recon that it's not easy breadcrumb related bug because if I set slash as value of frontpage it stores a totally different value (/node/2 in my case) so strange.
I will continue the debugging soon.
Any ideas are welcome!
Cheers,
Bálint
Comment #12
greg boggsSounds like a bug in core $this->siteConfig->get('page.front'); to me!
Comment #13
greg boggsComment #14
greg boggsIf that is indeed the cause, we can work around it could be somewhere lower in the code doesn't like the value of / for front page.
Comment #15
junkunczWell if I try to get the frontpage url in a different way then it's fine for me with a slash as well!
current code:
$front = $this->siteConfig->get('page.front');my change:
$front = Url::fromRoute('<front>')->toString();I know a static call is not the best inside this class but seems okay.
Probably a bit better idea to inject UrlGeneratorInterface to the class as a dependency.
You could have a look if you have time!
Thanks!
Comment #16
guaneagler commentedMy configuration like the image upload below.
I want to hide the breadcrumb in the font, but it still shows in the front.
I have checked the code and find that it is caused by the front page path. drupal 8 set the real node path in 'page.front', eg: node/1.
When the code below executes, $front is not equal to the path to the front page.
I solve this by add aliasManage and get the front page path alias for $front.
Comment #17
junkuncz@guaneagler Yes your patch really solves the path problem BUT I found another one which is also an issue.
There is a foreach loop which iterates on the the path_crumb_rows which are set on the settings form IF it is set!
Currently this loop runs there is no replace path set and it's not fine that's the reason why the code never reaches the frontpage related part (in the foreach loop there is a return $breadcrumb->setLinks($links);)
I've attached a patch, please have look and test it yourself.
Hope that helps!
Bálint
Comment #18
junkunczSorry this one should be okay let's see the tests.
Comment #19
junkunczComment #20
greg boggsThis is a lot of complex code that will give folks a white screen of death on module upgrade to work around a pretty obscure bug with front page settings. Can we solve this just by updating the help text on the front field?
Comment #21
junkunczThat’s okay from my perspective.
Comment #22
junkunczI've added a note to the config form @Greg Boggs I hope you thought so. :)
Patch is attached.
Comment #23
renatog commentedThe message can help other users. Makes sense
Comment #25
renatog commentedCommitted to the dev branch.
Thank you all for helping