Breadcrumb path matching order not correct in terms of specificity

Created on 5 September 2024, 2 months ago

Problem/Motivation

The path matches the wrong breadcrumb because the order the rules are checked is by id number so the first created will be used. Appears to be a regression from 797470 β†’

When I have a path like /parent/* and another like /parent/child/grandchild/* if the URL is /parent/child/grandchild/page it should match the /parent/child/grandchild/* rule not the /parent/*

Steps to reproduce

Create a rule for a very short path, and also create a rule for a longer sub path

Proposed resolution

I just usorted in reverse based on the number of /s in the URL, to determine depth to fix it, but I wonder if there is a better way to determine specificity, and maybe it should be stored or calculated up front. The things that I thought of for specificity are

  • depth, # of /s
  • matches, # of *
  • token use
πŸ› Bug report
Status

Active

Version

1.1

Component

custom_breadcrumbs

Created by

πŸ‡ΊπŸ‡ΈUnited States EHLOVader

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024