Closed nilshoerrmann closed 11 months ago
PS: The same issue exists for custom separator settings in Str::$defaults['slug']['separator']
.
The fix is not quite as easy, as the JS helper will not use the passed allowed characters, but only add them to the default a-z0-9
, so that wouldn't allow overwriting default allowed with a. more restricting set.
Wouldn't changing https://github.com/getkirby/kirby/blob/v4/develop/panel/src/helpers/string.js#L173C2-L173C30 to allowed = allowed ? allowed : "a-z0-9";
solve this issue?
I understand that this would not be backwards compatible but I'd technically consider this a bug because the panel behaves differently compared to the backend (and the backend actually allows for complete customization).
Description
Kirby allows for the creation of custom slugs rules by setting the static property of the
Str
class:These settings are not passed to the
create
andchangeTitle
dialogs.Expected behavior
The panel should respect the general slug settings.
To reproduce
Set custom rules in a page model or the config, create a page or update a title. The slug will always be created based on the default settings.
Additional context
Passing
'allow' => Str::$defaults['slug']['allowed']
to the slug field will fix this issue, see here: