Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using the Index hierarchy processor, when a child item is active, the parent item is not present in the breadcrumb.
It seems that in facets_system_breadcrumb_alter() at line 295 of facets.module, we just iterate on active parents and not on active children too. So when a child is active (and then the parent is inactive), we miss the parent and don't place it into the breadcrumb.
The patch attached seems solving that and place the inactive parent item in the breadcrumb. We need also to place the child in the breadcrumb, I look foward to do it this week.
Comment | File | Size | Author |
---|---|---|---|
#10 | missing_parent_item_in-2917854-10.patch | 2.58 KB | borisson_ |
#10 | missing_parent_item_in-2917854-10--testonly.patch | 1.99 KB | borisson_ |
Comments
Comment #2
borisson_Can we use
||
instead ofor
in this patch? This will be a new coding standard in the future (see #2890524: Disallow `or` or `and` in Logical Operators (use `||` or `&&`)).I'd also love to see test coverage for this, not sure if we should do this in BreadCrumbIntegrationTest or in HierarchicalIntegrationTest though, I think the first makes more sense?
If you don't know how to - or can't get around to writing the tests I don't mind having a go at it.
Comment #3
KarimB CreditAttribution: KarimB commentedSure we can @borisson_ ... Here is the patch with || .
Yes, it makes more sense to test it with BreadCrumbIntegrationTest but I'm not an expert writing tests :)
Comment #4
KarimB CreditAttribution: KarimB commentedNow the patch without the complete route, so we can use it with composer.
Comment #5
borisson_Setting to needs review so this shows up more prominently on my radar. Also to see if it breaks any of the current tests.
Comment #7
borisson_Patch doesn't apply on head anymore.
Comment #8
borisson_Patch was corrupt and didn't apply, rerolled.
Comment #9
borisson_Back to NW for tests.
Comment #10
borisson_Comment #13
borisson_Committed and pushed, thanks!
Comment #15
kebne CreditAttribution: kebne commentedThis issue might persist since not all parents are shown in my breadcrumb trail. Running ver 8.x-1.4.
Facets shows:
Clothes
-Male
--Jackets
Crumb shows:
Home > Store > Clothes > Jackets
Should be:
Home > Store > Clothes > Male > Jackets
Another example:
Facet shows:
Spare parts
-Car parts
--Engine
---Engine Belt
----Timing Belt
Crumb shows:
Home > Store > Spare parts > Timing Belt