"/" characters are removed from the breadcrumb link which is output when using the
| identifier.
any line calling the pathauto_cleanstring function with the second parameter should be updated, as the second param is no longer supported

suggested code for stable version (custom_breadcrumbs.module line 158):
$patharray = explode('/', $path);
foreach($patharray as $k=>$v){
$patharray[$k] = pathauto_cleanstring($v);
}
$path = implode('/', $patharray);
$crumb = l($title, $path);

suggested code for beta 3 - (custom_breadcrumb_identifiers.module):

$patharray = explode('/', $options['path']);
foreach($patharray as $k=>$v){
$patharray[$k] = pathauto_cleanstring($v);
}
$options['path'] = implode('/', $patharray);
$crumb = l($obj['title'], $options['path'], $options);

Sorry, not sure how to do a patch.
This also does not account for '/' characters in token fields, which should be processed separately and also needs to be resolved.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

murraybiscuit’s picture

let's try that first line again...
"/" characters are removed from the breadcrumb link which is output when using the <pathauto>| identifier.

seehawk’s picture

Priority: Normal » Major

Having the exact same issue on my site.

MGN’s picture

Thanks for reporting this. I think #881276: Fatal error: Call to undefined function pathauto_cleanstring() is reporting the same problem, but this issue has more information so I'll mark that issue as a duplicate. That issue indicates that 6.x-2.x doesn't have this problem, so the solution is to backport the changes that have been made in the 6.x-2.x version.

dwadson’s picture

Updating to 6.x-2.x removes the "Fatal error: Call to undefined function pathauto_cleanstring()", but the slashes ("/") are still being removed from the breadcrumb links.

MGN’s picture

Version: 6.x-1.5 » 6.x-2.x-dev
Status: Active » Needs review
FileSize
1.11 KB

I've confirmed that pathauto integration is now broken in both 6.x-1.x and 6.x-2.x versions of custom breadcrumbs due to the the change to the pathauto_cleanstring function introduced in #545216: Fix pathauto_cleanalias() and pathauto_cleanstring().

I think murraybiscuit's suggestion is correct. I don't think there will be any problem with slashes in token strings because by the time this function is called, tokens have already been replaced.

Attached is a patch for 6.x-2.x-dev. I would appreciate it if others could test this and verify that it fixes the problem before I commit it.

qds013’s picture

MGN, thanks for the patch! I confirm it works now with pathauto 6.x-1.4.

leon85321’s picture

Hi, thx for the fix, but it does not work for me.
this works ->
|[term-raw]/[title-raw]
this does not work -> [title-raw]/
|[term-raw]

ecksley’s picture

After a recent update to 6.x-2.x-dev I found that my existing breadcrumb paths which were configured like the following such:

/<pathauto>|node/21

were outputting as:

http://myurl.com/node21

I have since changed my path configuration to:

/node/21

and it now outputs the full url alias as it once had because of the extra path auto segment. Perhaps the path auto feature is now cooked into all custom breadcrumbs without the manual designation?

That said, I also ran your patch and it is working for me. I guess the question is, should I go ahead and redo my breadcrumbs anyway if the path auto feature seems to work without the prefix?

Thanks for the patch!

MGN’s picture

@leon,

The pathauto identifier is designed to be the first item on the line so the correct usage is <pathauto>|[term-raw]/[title-raw]

Your second scenario ([title-raw]/<pathauto>|[term-raw]) shouldn't work....at least it wasn't designed for that kind of usage...

MGN’s picture

Status: Needs review » Reviewed & tested by the community

@ecksley, I am not sure I am following your question.

I can't think of a scenario where node/21 would need the pathauto special identifier. If an alias for node/21 exists it will automatically be used (see the url api function for details).

The pathauto special identifier is useful if you need to clean a string according to the pathauto rules - for example, replacing spaces returned by tokens with dashes or underscores or....

But it sounds like we can go to RTBC on the patch.

ecksley’s picture

Thanks for explaining that MGN. I misunderstood the use of the pathauto identifier.

MGN’s picture

Status: Reviewed & tested by the community » Fixed

This has now been committed to 6.x-2.x-dev.

MGN’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Still need to fix the 6.x-1.x-dev branch.

MGN’s picture

Status: Patch (to be ported) » Needs review
FileSize
943 bytes

Here is the patch using murraybiscuit's code. I would appreciate it if someone could test it against the latest code and verify that it works as expected. Thanks.

texas-bronius’s picture

Hi - fwiw, the patch in #14 fails against stable 6.x-1.5 for me. Yes, I know this is a patch against -dev.

Note to others: If manually applying the patch this patch to 1.5, you will need to prepend:
module_load_include('inc', 'pathauto', 'pathauto');
to gain access to the pathauto_cleanstring function.

MGN’s picture

Do you mean the path fails to apply or that, after manually pathcing, the patch doesn't fix the problem?

texas-bronius’s picture

Ok so regarding the patch in #14, the custom_breadcrumbs generated link to the document is a full path, whereas the path generated by pathauto is truncated a bit-- therefore the two don't sync up. This may be an unrelated issue.

Ex:
for the pathauto setting:
about-us/press-releases/[field_pr_date-yyyy]/[title-raw]
pathauto generates this path:
about-us/press-releases/2006/kirk-heinritz-appointed-vp-corporate-strategy-and-organizational-develo
custom_breadcrumbs generates this path:
about-us/press-releases/2006/kirk-heinritz-appointed-vp-corporate-strategy-and-organizational-development
(notice the "ment" at the end of custom_breadcrumbs generated path)

cyberderf’s picture

Well I'm confused.

What releases of pathauto/custom breadcrumbs works together, and with which patch.

Can someone sort it out for me! ;)

cyberderf’s picture

By the way last dev version is from 2010-Oct-27. I still have the bug. Why is this patch not added to the lasat release ?

MGN’s picture

The patch hasn't been committed yet because it hasn't been tested and marked RTBC yet. All of my sites are running 6.x-2.x-dev now, so I'll need some help to troubleshoot these problems. I don't see any problems with 6.x-2.x-dev and pathauto 6.x-1.4 - sorry I haven't had a chance to upgrade to pathauto 6.x-1.5 and test it yet. I do see that there has been some important recent changes in pathauto 6.x-1.5 so the problems that you are seeing might be related to that.

@texas-bronius, it looks like pathauto is truncating at 100 characters - from reading through the recent commits to pathauto, I think this is a new setting in the pathauto module. You might be able to fix the problem by increasing the maximum length of the pathauto alias. It looks like the pathauto_cleanstring function (which custom breadcrumbs has been using...) does not truncate. Sorry I can't offer more help on this since I am still on pathauto 6.x-1.4...

laroccadahouse’s picture

i'm using 1.5 and applied the patch from #14. works for me!

lamp5’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)