When Panels everywhere is active, and the breadcrumb is printed in the site template provided by panels everywhere, tokens are not working.
I tested this by creating a panels everywhere panel which prints the page breadcrumb
then I created a panel for a term view page, and altered the breadcrumb overthere.
Problem seems to be panels breadcrumb triggers multiple times, and last time is the panels everywhere page, which tries to render the breadcrumb with the configuration provided in the term view panel, but has not the needed context to render the correct breadcrumb.
Comments
Comment #0.0
strykaizerextra info added
Comment #1
hydra commentedI can confirm this bug. Unfortunally I havend found a good solution for it yet :(
A possible workaround for this, till this is fixed, is to don't use panels_breadcrumbs_build_breadcrumb for getting the breadrumb but directly call drupal_get_breadcrumb, since panels_breadcrumbs_build_breadcrumb is calling drupal_set_breadcrumb.
For easy use just replace panels_breadcrumbs_page_breadcrumb_content_type_render with the code below.
panels_breadcrumb.module line 250
I just removed the else condition for drupal_get_breadcrumb.
Comment #2
das-peter commentedHow about this: Besides the panelizer configuration we also store the contexts used for this configuration and re-use it later if applicable?
Comment #3
hydra commentedThis works for me, thanks! Way better then my hack :D
Comment #4
leksat commentedI have the same issue, but with a page_manager page implementing a site search.
The panels_breadcrumbs_build_breadcrumb() function is called twice, and the second call has incorrect contexts.
The #2 patch does not helped me, because the panels_breadcrumbs_panelizer_pre_render_alter() function (where the correct contexts are stored) is newer called.
To quick-fix this issue, I just added a static cache to the panels_breadcrumbs_build_breadcrumb() function. See https://github.com/AmazeeLabs/panels_breadcrumbs/commit/c73707
I'm not sure whether this is a correct solution, but actually it does the same job + saves some resources.
Comment #5
Cogax commented#4 woked for me!
Comment #6
das-peter commentedExtended the approach from #2.
Hope it covers more use cases now.
To properly test this we would need a whole bunch of possible scenarios.
Comment #7
rozh commentedI have site with panels_everywhere and panelizer.
Entityreference and taxonomy term contexts was added on node/%node page. Before applying patch from #6 tokens from contexts was empty. Now everything is great.
I'm ready to test some scenarios if you point me what kind of configuration we need to test.
Comment #8
rozh commentedTokens doesn't work on panelized nodes with Panels Everywhere.
Comment #9
damienmckennaComment #10
damienmckennaSorry, wrong issue.
Comment #11
summit commentedHi,
Is this patch https://www.drupal.org/node/2124813#comment-9143801 still valid?
Anyone else tested this?
greetings, Martijn
Comment #12
b-prod commentedActualy I do not understand why the
panels_breadcrumbs_page_breadcrumb_content_type_render()renders a breadcrumb that has already been set by thepanels_breadcrumbs_panelizer_pre_render_alter().This means that the breadcrumb is built 2 times, which is not good for performances.
So the breadcrumb should only be built if its configuration is manually defined in the pane configuration. Otherwise the
drupal_get_breadcrumb()function should be called, getting the last breadcrumb set. Moreover, this ensure a better compatibility with others modules that may deal with the breadcrumb.Comment #13
b-prod commentedThe following patch stores the first built breadcrumb and returns it when the
panels_breadcrumbs_build_breadcrumb()is called.This means less processing (the breadcrumb is only built once), less memory usage (no context stored, only a small array containing the breadcrumb).
Comment #14
b-prod commentedAny news on this?
Comment #15
jdcrisamore commentedThis fixed the issue I was having today with Taxonomy tokens not working with panels breadcrumbs! This should definitely be a candidate for the next release.
Thanks B-Prod!
Comment #16
b-prod commented@jdcrisamore So could you please set this issue as Reviewed? Like that we could hope having this fixed in a future release.
Comment #17
sdstyles commentedThe patch works as expected.
The issue is present on 7.x-2.2 too, so changing version to 7.x-2.x-dev
Comment #18
IreneV commentedWill be added in next module release
Comment #20
IreneV commentedComment #21
IreneV commented