Problem/Motivation

The token in the URL is not correct.

Steps to reproduce

1. Install the module
2. Content with a taxonomy term field
3. Taxonomy term with Pathauto pattern tid/name, so the generated alias is like 10001/category-1
4. set the pat as /[node:field_category:entity:url:path] in custom breadcrumbs

The path only shows /category-1 without 10001. I try to add the tid byt setting the path as /[node:field_category:entity:tid]/[node:field_category:entity:url:path] in custom breadcrumbs, but it show twice of the tid in the path, which is 10001/10001/category-1.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hongqing created an issue. See original summary.

hongqing’s picture

Title: Incorrect token in path » Incorrect path from token
lamp5’s picture

This is custom breadcrumbs module, not token module, let's report this in token issue queue.

hongqing’s picture

Status: Active » Closed (works as designed)

I filed a bug in the Token issues #3362620.

jjose.quevedo made their first commit to this issue’s fork.

jjose.quevedo’s picture

Status: Closed (works as designed) » Active

Hi, after carefully reviewing both cases (the current issue and 3362620), I have identified that the presence of a forward slash (/) is causing complications with the token replacement process. Therefore, I strongly recommend implementing the proposed change to address this issue.

By incorporating the suggested modification, we can ensure that any forward slash added by a user in front of a token string will be automatically removed before further processing. This adjustment will significantly contribute to maintaining consistency within the system and eliminate the possibility of encountering conflicts or unexpected behavior.