More breadcrumb troubles...

I have a few pages in a single view using a wildcard

projects/%/support
projects/%/support/bugs
projects/%/support/features

When one of the last two are used, the breadcrumb will try to literally link to "projects/%/support" (actually the url is /projects/%25/support).

This strange occurrence is blocking me from fixing the breadcrumb problem completely by using the "menu breadcrumbs" module.

Any ideas on how to stop this oddness?

Comments

RoboPhred’s picture

I changed the urls so that all are on their own level:

projects/%/support
projects/%/bugs
projects/%/features

But the issue still occurs on the second two and not on the first. My guess is that the module seems to be considering all page views after the first one as children of the first.

RoboPhred’s picture

Started bashing at url with a hammer and a mess of drupal_set_message

includes/views.inc

        if ($this->display_handler->uses_breadcrumb() && $argument['handler']->uses_breadcrumb()) {
          $path = $this->get_url($breadcrumb_args);
drupal_set_message('bc path: ' . $path);
          if (strpos('%', $path) === FALSE) {
drupal_set_message('no %, setting to bi data');
            $this->build_info['breadcrumb'][$path] = str_replace(array_keys($substitutions), $substitutions, $title);
          }
        }

So far, I have not been able to find what function is being called by "$argument['handler']->uses_breadcrumb()", or why it is only true when $this->current_display != 'page' (it only shows up on the other page views with names like page_1, page_2, ...).

I have found, however, that the strpos does not seem to work. It will add the path to the breadcrumb information even when it has "%" in it.

bc path: projects/%/support/features
no %, setting to bi data

RoboPhred’s picture

Status: Active » Needs review

Seems to be reversed arguments in the strpos func. It should be

        if ($this->display_handler->uses_breadcrumb() && $argument['handler']->uses_breadcrumb()) {
          $path = $this->get_url($breadcrumb_args);
          if (strpos($path, '%') === FALSE) {
            $this->build_info['breadcrumb'][$path] = str_replace(array_keys($substitutions), $substitutions, $title);
          }
        }

That solves the issue for me, but I would still like to know why the handler in $argument['handler'] only enables the breadcrumb on all page views other than the first created page view.

merlinofchaos’s picture

Status: Needs review » Fixed

This is fixed; I don't fully understand what the issue is on 'other than the first created page view' -- maybe it's that the breadcrumb in question is being handled by menu module in that case?

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

pasqualle’s picture