Hi,

I am trying Path Breadcrumbs again on a new project after over a year since I tried it previously.. Seem to be having similar issues though..

I have a content type with a field collection field.. When viewing a field collection item I want the breadcrumb to show a link back to the main content.. I couldn't find a way to do this directly.. I also have an entity reference field in the field collection referring back to the main content but that does't help either..

The issue as I see it is that while the substitutions are working for the "Link Title" they are not working for the "Link Path".. The paths are coming out as the actual content of the "Link Path" field..

So so using %FCID:url in both the "link title" and "link path" generated this as the html link..
<a href="/%FCID%3Aurl">https://site.com/field-collection/field-pat-fc-treat/37</a>

So the substitution is being used for the title but doesn't appear to be working for the path..

Any thoughts on why not?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wipeout_dude’s picture

Issue summary: View changes
kalabro’s picture

Status: Active » Postponed (maintainer needs more info)

Hello @wipeout_dude!

Please provide your PB item export and screenshot with your fields names (admin/structure/types/manage/%node_type/fields).

Best,
Kate

Adirael’s picture

I'm having the same issue. When I use context placeholders on the link path they are not replaced with their values. They work on the link title though. I end up with a link that looks like this: <a href="/en/%CEnter%3Aurl">Test center</a>

In _path_breadcrumbs_build_breadcrumbs function (path_breadcrumbs.module:181) the following code is executed, encoding the % symbol in the $paths variable. I think that's the cause for this issue.

// Replace %nn sequences to prevent mixing them with contexts.
$paths = rawurldecode($paths);

I'm not sure if this is the cause, but commenting that line fixes it for me. It was introduced as a fix to #2118329

kalabro’s picture

Could you please post exact token name that is not replaced after rawurldecode?

Adirael’s picture

This are my options. The tokens on path title are replaced, the ones on the path link aren't

Breadcrumb configuration

And my arguments

Breadcrumb arguments

According to XDebug, on path_breadcrumbs.module:179 $paths value is set to

admin/center/%center:nid/requests
admin/center/%center:nid/requests
%center:url

Then on 182 is replaced by

admin/center/�nter:nid/requests
admin/center/�nter:nid/requests
�nter:url
kalabro’s picture

FileSize
23.9 KB

This is why I asked: #2394337: Link %variable broken by rawurldecode()
PB now disallows some token names on the first step. Just rename %center to some other name.

Adirael’s picture

That explains why it wasn't happening everywhere, in other breadcrumbs I was just using %node.

Thanks a lot!