Skip to content

[Validator] Revert Slug constraint #60475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented May 19, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? no
Issues Reverts #58542
License MIT

After an internal discussion, I think it's best to revert the introduction of the Slug constraint:

  • There is no official standard for slugs, or what a slug means exactly. Within Symfony, it would be best to comply with what our AsciiSlugger is doing, but a more common approach is to only allow lowercase characters.
  • The constraint adds little on top of the existing Regex constraint, especially when using it's regex option to customize the pattern for slugs.

Considering this, I believe it is always better for applications to be clear on what they allow in a slug using the Regex constraint.

@carsonbot carsonbot added this to the 7.3 milestone May 19, 2025
@wouterj
Copy link
Member Author

wouterj commented May 19, 2025

cc @raffaelecarelle, as the original author of the PR. If there is something we're overlooking or you see value in the constraint that I'm missing, please feel free to share it here so we can consider it.

@xabbuh xabbuh added Validator ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" labels May 19, 2025
@carsonbot carsonbot changed the title Revert Slug constraint [Validator] Revert Slug constraint May 19, 2025
@ajgarlag
Copy link
Contributor

ajgarlag commented May 19, 2025

I think PR #59383 should be reverted too

@94noni
Copy link
Contributor

94noni commented May 19, 2025

Warning

you must also update/amend the corresponding blogpost otherwise ppl will think its a fail of release no ?

@fabpot
Copy link
Member

fabpot commented May 20, 2025

PR on 6.4 to remove the translations: #60486

@fabpot
Copy link
Member

fabpot commented May 20, 2025

Thank you @wouterj.

@fabpot fabpot merged commit 9ec163b into symfony:7.3 May 20, 2025
11 checks passed
fabpot added a commit that referenced this pull request May 20, 2025
This PR was merged into the 6.4 branch.

Discussion
----------

Remove translations for slug validation error

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        |
| License       | MIT

Related to #60475

Commits
-------

42eb1c0 Remove translations for slug validation error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed Validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants