Can't edit existing tokens after beta1 update

Created on 18 February 2025, about 2 months ago

Problem/Motivation

After updating the module to the latest beta1, we cannot edit existing tokens.

It seems like the machine name implementation with replace / replace_with have blocked the use of underscores in machine names, which is problematic to existing implementations.

Steps to reproduce

When using an older version of the module, create a token that uses underscores.

Then update the module to the latest version (8.x-1.0-beta1).

Finally, go to edit the previous token.

As you click save, you should be presented with a similar error, blocking you from completing an edit to an existing token:

Proposed resolution

For backwards compatibility, we should be able to at least edit existing tokens that still use underscores.

Ideally, at this point, maybe make a setting to choose between using underscores or dashes as the default.

Alternatively, if this is going to be a forced update, an update hook would need to update all instances of underscored tokens in the database with dashes (current tokens and all fields).

Having old tokens that use underscores and new tokens use dashes is not ideal, as it can cause issues in how one might reference these items and will be hard to keep track of which to use and where.

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agbockus Illinois

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