When using language prefixes, image styles don't work. This is because currently the LanguageServiceProvider and PathProcessorImageStyles both have priority 300. Without the path being processed to remove language prefixes beforehand, the images processor will not properly match. The code was introduced in #1910318: Make path resolution the responsibility of a series of PathProcessor classes, rather than one PathSubscriber class
Comment | File | Size | Author |
---|---|---|---|
#1 | 2499127.patch | 1.1 KB | dasjo |
Comments
Comment #1
dasjoAttached is a patch by schnitzel that fixes the problem.
Setting to needs work as this probably needs test coverage.
Comment #2
dasjoComment #3
dawehnerIt would be great in general to document in the code why we need a certain priority
Comment #4
dasjoComment #5
Leksat CreditAttribution: Leksat at Amazee Labs commentedI'll try to reproduce this again, and if we still have the issue, write test and document code.
Comment #6
Leksat CreditAttribution: Leksat at Amazee Labs commentedI've checked this.
The issue was that something was generating image style URLs with language path prefixes. Example URL:
/de/sites/default/files/styles/thumbnail/public/file.jpg?itok=iEaM4I8M
It's not clear now which code added the path prefix. I was not able to reproduce this, so I removed the "Needs tests" tag.
But there are still reasons to get this committed:
1. As it's said in the description, LanguageServiceProvider and PathProcessorImageStyles both have priority 300. It's not clear which of them runs first.
Currently, PathProcessorImageStyles goes first because services defined in YAML files are registered before ones that come from service providers (code). This can be changed some day, so I would prefer to have the certain order.
2. If something will generate a language prefixed link to the image style, it will work. (This is really odd case, but it could happen, for example, if link is coming from a user input.)
Otherwise I would close the issue.
Comment #18
smustgrave CreditAttribution: smustgrave at Mobomo commentedBefore someone dives into this can someone confirm they are still seeing this in 9.5.x?
Putting the needs tests back.
Comment #19
smustgrave CreditAttribution: smustgrave at Mobomo commentedSince this moved to PNMI over 3 months ago, which is the threshold going to close as outdated.
If still a valid issue please reopen with an updated issue summary
Thanks