Skip to content

Fix the #31 slug delegation: it was a silent no-op without transliterate: true - #32

Open
mdon wants to merge 1 commit into
BeamLabEU:mainfrom
mdon:main
Open

Fix the #31 slug delegation: it was a silent no-op without transliterate: true#32
mdon wants to merge 1 commit into
BeamLabEU:mainfrom
mdon:main

Conversation

@mdon

@mdon mdon commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #31: the slug delegation that merged there was a silent no-op.

PhoenixKit.Utils.Slug.slugify/2 defaults :transliterate to false on every core
released so far, so the arity-1 call I added strips every non-ASCII character — exactly
what the local pipeline it replaced did. A Cyrillic template name still slugged to "".

This is the same defect the reviewer caught in BeamLabEU/phoenix_kit_dashboards#5
(ec8d080, "PR #5's slug change was a no-op"). It landed in this repo too and was not
caught here, because #31 had no pinning test.

Why my verification missed it

I tested against a local core where I had already made transliteration the default.
Against the core this module actually resolves, the change was inert. The code was right;
the shipped artifact was not, and only the second one matters.

Forward compatibility

Once core ships the locale-aware Slug (BeamLabEU/phoenix_kit#693, merged — pending a
release), :transliterate is accepted and ignored, so this stays correct. No second
change needed.

Remaining limitation, stated plainly

This makes Cyrillic work on a core new enough to have :transliterate. German and
Greek still degrade
until this module's phoenix_kit floor moves to the release
carrying locale_slug — the older transliterate maps Cyrillic only. That is a version
floor decision, not a code one, so it is left to whoever cuts it.

Caught by the upstream review of phoenix_kit_dashboards#5, which found the same
defect there and had to repair it after merge.

PhoenixKit.Utils.Slug.slugify/2 defaults :transliterate to FALSE on every core
released so far. So `Slug.slugify(text)` strips every non-ASCII character —
exactly what the local pipeline this change replaced did. The delegation was
correct and the behaviour was unchanged.

My verification missed it because I tested against local core, where I had made
transliteration the default. Against the core these modules actually resolve, it
was inert. That is the difference between "the code is right" and "the shipped
artifact is right", and only the second one matters.

Forward-compatible: once core ships the locale-aware Slug, :transliterate is
accepted and ignored, so this stays correct.

The pinning tests are rewritten to assert only what holds at EVERY core version.
Asserting output was the second half of the same mistake: each module resolves a
different core (posts' lockfile pins 1.7.189, which predates the :transliterate
option entirely), so a literal expected slug merges red.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant