Hi.
Have a problem with panels. Panels ctools plugin load breadcrumb variable before path_breadcrums set this variable. If I change hook_page_alter() to hook_init() to set breadcrumbs - all works fine.

Comments

chi’s picture

Title: Problem with overriding the breadcrumb » Support panels module
Category: support » bug

The issue isn't about panels_everywhere module. Ctools page_breadcrumb content type plugin renders breadcrumbs before hook_page_alter().

validoll’s picture

Issue occurs if breadcrumbs are placed in the page template.
In default site template breadcrumbs displayed normal.

Really, hook_init() solved problem.

philsward’s picture

Just noticed it isn't working as well...

@validoll you mind posting where you changed the code?

spleshka’s picture

Did you try latest release? I tested it with panels + panels everywhere and everything works fine.

philsward’s picture

Nope, even with the latest dev, it still isn't working for me :-/

Output of static breadcrumb on page:

<div id="breadcrumb" class="grid-12"><h2 class="element-invisible">You are here</h2><div class="breadcrumb"><span class="inline odd first last"><a href="/catalog">Shop All Products</a></span></div></div>

Output of Panels breadcrumb on page:

<h2 class="element-invisible">You are here</h2><div class="breadcrumb"><span class="inline odd first last"><a href="/">Home</a></span></div>  </div>

I'm using the breadcrumb region from the "Page elements" area of "add content" pane... I could have sworn it was working in the past.

I tried removing the breadcrumb path, re-adding it, removing all context and selection rules, doesn't matter won't show up for me in panels.

As you can see, it's a very simple and straight forward breadcrumb:

$path_breadcrumb = new stdClass();
$path_breadcrumb->api_version = 1;
$path_breadcrumb->machine_name = 'product_catalog_link';
$path_breadcrumb->name = 'Product Catalog Link';
$path_breadcrumb->path = 'node/%node';
$path_breadcrumb->data = array(
  'titles' => array(
    0 => 'Shop All Products',
  ),
  'paths' => array(
    0 => 'catalog',
  ),
  'home' => 1,
  'translatable' => 0,
  'arguments' => array(
    'node' => array(
      'position' => 1,
      'argument' => 'entity_id:node',
      'settings' => array(
        'identifier' => 'Content: ID',
      ),
    ),
  ),
  'access' => array(
    'plugins' => array(
      0 => array(
        'name' => 'node_type',
        'settings' => array(
          'type' => array(
            'product' => 'product',
            'product_kit' => 'product_kit',
          ),
        ),
        'context' => 'node',
        'not' => FALSE,
      ),
    ),
    'logic' => 'and',
  ),
);
$path_breadcrumb->weight = 0;
spleshka’s picture

Did you run update.php after update to the latest dev? There was one important fix for this issue.

philsward’s picture

I'm showing no pending updates and double checked the version I have installed: path_breadcrumbs 7.x-3.0-beta2+0-dev (2013-Apr-14)

spleshka’s picture

Oh, I'd love to help you, but I have no idea what modules you are using and why you are still gettin' this issue.

philsward’s picture

:-/ When I get a chance, I might see about stepping back to beta 1 to see if anything changes...

The 1.3 version of ctools wouldn't have caused the issue would it? I know I would have been running 1.2 when I thought it "was" working.

philsward’s picture

BTW, just checked a sandbox site with an older snapshot of modules and it is indeed working.

Old snapshot (working) version of modules:
Chaos tool suite (ctools) 7.x-1.3
Entity API 7.x-1.0
Path breadcrumbs 7.x-3.0-beta1
Panels 7.x-3.3+38-dev (2013-Mar-01)

Live snapshot (not working) version of modules:
Chaos tool suite (ctools) 7.x-1.3
Entity API 7.x-1.0
Path breadcrumbs 7.x-3.0-beta2+0-dev (2013-Apr-14)
Panels 7.x-3.3+38-dev (2013-Mar-01)

Never mind about the "ctools version" change... At some point, I updated the sandbox site for some other stuff and it is indeed working with ctools 1.3

philsward’s picture

Definitely something going on between beta1 and beta2

I updated the sandbox site from beta1 -> beta2 and the breadcrumb link disappeared once b2 was installed (and db updated). Updating from b2 -> latest dev did not help.

Do you think the new weighting of the module might have something to do with it?

Going to blow away (uninstall) the b2 version I have and step back down to b1. I tried stepping down on my live site to b1 but it didn't help. I'm wondering if the db update in b2 is causing it to still not work when downgrading from b2 -> b1

philsward’s picture

Yea! It's working now on b2 :-)

I exported the breadcrumbs, uninstalled b2 and re-imported the bookmarks and now they are working :-)

Looks like something got messed up in the db or something keeping it from upgrading nicely from b1 -> b2??

philsward’s picture

Grr! Went to do some theming updates to whatever changed between b1 and b2, cleared the css-js cache and the custom link disappeared again...

One thing I did change in the settings was the delimiter... I changed it from » to a whitespace. Dunno if that was the cause yet but changing it back to » hasn't made a difference (yet) Maybe after 10 more times of clearing the cache, something magic will happen...

philsward’s picture

K, uninstalled everything and downgraded back to beta1... As of the moment, it's working but being intermittent... Clear the cache, it disappears, clear it again it shows back up. I'm going to wait a bit to let all of the system caches clear out before saying "its a problem", but I am definitely leaning towards there being a problem with beta2...

spleshka’s picture

Really interesting.. Beta2 contains simple increase of module weight and changed breadcrumb invoke on hook_page_alter() instead of hook_init(). That's all changes I've made.

philsward’s picture

Sorry for all of the play-by-play updates :-p

I wish I could help out more than "just testing it" but I'm at the mercy of my lack of coding knowledge :-/

So far the link is still showing up in beta1 though :) Must have been a cache issue with the intermittent display.

das-peter’s picture

@philsward Do you output the breadcrumbs using the Panels / Ctools page element "Breadcrumbs" (ctools_page_breadcrumb_content_type_render)?
I guess the issue is that the panel stuff is rendered before hook_page_alter() is invoked.
We could workaround this by implementing hook_panels_pre_render() and simply call path_breadcrumbs_page_alter().
However, for other modules this still could be an issue if they rely on the breadcrumbs before hook_page_alter() is invoked.
@Spleshka I guess the code was moved to hook_page_alter() for performance reasons?

I guess the best solution would be to be able to use hook_menu_breadcrumb_alter() but unfortunately this hook isn't invoked if the frontpage is rendered, see: menu_get_active_breadcrumb()

philsward’s picture

@das-peter

Do you output the breadcrumbs using the Panels / Ctools page element "Breadcrumbs"

Yes

(ctools) Add Content -> Page Elements -> Breadcrumb

kalabro’s picture

Status: Active » Fixed

Should be fixed in 7.x-3.x: http://drupalcode.org/project/path_breadcrumbs.git/commitdiff/920d848

Decided not to use hoot_init() now. Actually different modules want to play with breadcrumbs in different time. For example, core taxonomy ignores breadcrumbs from hook_init() (#1959052: Cannot change term page breadcrumbs).

philsward’s picture

Noticed that beta3 is out. I'm still on beta1 on account of this issue. I'll try to get the courage to install b3 here in a few days and let you know how things work out.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

more tech correct