Exclude URLs are not handled properly.
Pages get trapped in infinite loop.

Comments

ashhishhh created an issue. See original summary.

ashhishhh’s picture

StatusFileSize
new561 bytes

Here is the patch.
Changed to
break;
instead of
continue;

greg boggs’s picture

Status: Needs review » Fixed

Thanks!

Derimagia’s picture

This code is not the correct way to fix this. The reason why it's in an infinite loop is because you do an array_pop later down the code. This really makes excluded paths even worse. Consider the following scenario:

1) You have a view on /blog that displays all blog posts.
2) The blog posts have a path at /blog/2016/06/node-title

You have a breadcrumb of:
Home > Blog > Blog

If you wanted to remove the last blog you could add:
blog/2016

to your exclude list. What this code does isn't make is so that link doesn't show, but it exits the loop so no breadcrumbs are displayed at all.

tldr of it is continue; is right - it just needed a array_pop before it.

Secondly the exclusions are not put through an exclusion, which contradicts the description of the field. "report/2[0-9][0-9][0-9]"

greg boggs’s picture

Hi!

The exclusions feature needs work for sure. Patches welcome. I actually never used the feature in D7, so I don't really know what it did in D7. But, I see two ways that it could work, and maybe we should have a config option for both ways.

1. When a path matches an exclude, that path gets no breadcrumb
2. When a path matches an exclude, it does not appear as the parent of a child page

So, if your path is /blog/2016/06/my-post

With no excludes, if all paths were valid, your crumb would be:

Home > blog > 2016 > 06 > My post

Say for example, you didn't want the dates in the crumbs even though they are valid paths, you should be able to exclude 2016 and 06. How you could exclude all possible date paths, I'm not sure perhaps exclude [0-9] and the code would be smart enough to exclude all paths that contain only numbers.

Of course, when you excluded those paths, the date archive pages themselves would then have no crumbs, which could not be what you wanted there because they might have a breadcrumb of just Home which could be a weird dangling link.

Derimagia’s picture

Yeah I can see the use full that. What was the original intention of it ? I ask because the example seems like it was for the second one.

For the path question about dates, I the example again that the description gives is regex and it says is regex? I would need to check the D7 version to see if it uses it there or check the git history when I get back to what I was working on here. Are there any hooks that are available here that give people more options? (I use hooks in a loose term).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Derimagia’s picture

Update on this? If you're not supporting this feature then are you removing the description?

greg boggs’s picture

Hi Derimagia,

Sorry about that, we never updated the status when we added more to this ticket so the automatic bot came through and closed the ticket on us. Improvements to the excludes feature are welcome!

r-mo’s picture

Sorry to necro, but think the context is useful. Attached patch to use array_pop and continue, along with using the path matcher service for the excluded paths.