Repository navigation
Add the normalize_filter_set_names option and deprecate the normalization of filter set names - #1676
Merged
dbu merged 3 commits intoNov 15, 2026
Conversation
dbu
approved these changes
Nov 14, 2026
dbu
left a comment
Collaborator
There was a problem hiding this comment.
thanks, good idea for the deprecation warning only when relevant in the application!
i only have a small request for the documentation, the users might want the underscores, but then they need to use underscores in their config (be it xml or yaml)
| configuration, so ``my-thumbnail`` has to be used as ``my_thumbnail`` in templates and in the URLs. | ||
| This normalization is deprecated, and will be removed in version 3. To use your filter set names as | ||
| written, set ``normalize_filter_set_names`` to ``false``, and replace the underscored names in your | ||
| templates and code: |
Collaborator
There was a problem hiding this comment.
i'd say "and make sure the names in configuration and your templates/code match literal".
Contributor
Author
There was a problem hiding this comment.
Thanks, reworded along your suggestion.
| - __[Deprecated]__ A filter set name that contains a `-` and no `_` is renamed by the Symfony configuration, so | ||
| `my-thumbnail` has to be used as `my_thumbnail`. This normalization is deprecated and will be removed in 3.0. Set the | ||
| new `liip_imagine.normalize_filter_set_names` option to `false` to use the filter set names as written, and replace | ||
| the underscored names in your templates and code. |
Amoifr
force-pushed
the
feature-1670-filter-set-names-normalization
branch
from
November 15, 2026 08:50
e47738a to
36bf009
Compare
dbu
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #1670: a new
normalize_filter_set_namesoption,trueby default, so thatmy-thumbnailcan be used as is once it is set tofalse.The option changes the configuration tree (
normalizeKeys()onfilter_sets), so the extension reads it from the raw configs before processing them, and passes it toConfigurationthrough a new optional constructor argument. The last config file that sets it wins, like for any other option.About the deprecation, one deviation from what you suggested, easy to revert if you prefer the strict version: it is only triggered when the normalization actually renames a filter set (a name with
-and no_, same condition as Symfony'sArrayNode::preNormalize()), or when the option is explicitly set totrue. An application without such a name is not affected by the 3.0 change, so asking everyone to addnormalize_filter_set_names: falseseemed like noise. The message lists the renamed names:While checking, I noticed that filter sets declared in XML (
<filter-set name="my-thumb">) were never normalized, since the key comes from thenameattribute after the key normalization. They don't trigger the deprecation, and the docs say so.For 3.x, dropping the normalization means removing the option and the
normalizeKeys()call (or keepingnormalizeKeys(false)).Tested: the new tests fail without the change, full suite green on PHP 8.5, php-cs-fixer clean. PHPStan (PHP 8.2) reports nothing on the changed files, only the vips and asset-mapper classes that the CI job installs first.