Numeric token type names are reset

Created on 5 February 2024, about 1 year ago
Updated 24 April 2024, 12 months ago

Problem/Motivation

If a token type name contains only numbers (eg. 403, 404), array_multisort resets the indexes (to 0, 1).

Steps to reproduce

I discovered this issue when using tokens from the Node Singles module in a Pathauto pattern, more specifically tokens of two node types named '403' and '404'. What should have been [node_singles:403] became [node_singles:0].

Proposed resolution

Sort the keys separately and re-combine them with the values afterwards (see this StackOverflow answer)

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024