Problem/Motivation
I updated drupal yesterday. When i flushed the image style cache i now get all urls inside the picture tag encoded. Using the responsive picture formater. With the normal "image" formatter all will work like expected.
/sites/test/files/styles/pd5_max_400/public/2022-01/JBL-LIVE-650-BTNC-058.jpg%201x
%201x will the cause that no images are displayed at all. before it justwas "1x". it seems the space before it now is encoded and will break my paths.
Anyone else has that problem? Ican debug using xdebug if i get a hint.
Comments
Comment #2
marcoka commentedThat was somehow temporary, unknown why. The encoding is correct. Works again.That was a mistake. It seemed to work because i manually removed that token from the source using inspect and that generated the image.
The problem is that an url like
srcset="/sites/test/files/styles/pd5_max_400/public/media/ich-1.jpg?itok=Izzc9hA-%201x"
Will not be called by chrome/vivaldi and no derivate is generated. If i manually remove %201x it will be generated and loaded if i hit f5.
Comment #3
marcoka commentedComment #4
marcoka commentedComment #5
cilefen commentedFrom which version to which version? Did you update Drupal core only?
Comment #6
marcoka commentedI updated everything that is installed. Actually i forgot from which version. It was from 9.2 something.
On another site that uses 9.2.9 the urls are generated without the encoding of the space, meaning like this
"srcset="/sites/test/files/styles/pd5_max_300/public/fragen-infos.jpg 1x"
So it is not the browser(i thought about that too).
Do you have the urls encoded too or without that %20?
Info: It is not caused by the itok code part. To test that i hacked core and disabled the if statements that add the itok string. Reverted it after.
Comment #7
cilefen commentedIf this is a regression bug it can be solved much faster if we know the versions, which would could derive the steps to reproduce.
Comment #8
cilefen commentedYou can use https://simplytest.me/ to verify the current behavior of Drupal core.
Comment #9
marcoka commentedI checked my rsanpshots and i think it was 9.3.9 or before. I can not say for sure as i have no backup(shame on me).
Ok installed the unami demo locally, 9.3.12
Wil try to debug it somehow.
Comment #10
cilefen commentedComment #11
marcoka commentedI tracked it down to the point where the image is delivered and it is the itok hash check that blocks my images from beeing generated at all.
Here is a xdebug screenshot.
http://www.root.artwaves.de/sharex/25-04-22--17-40-46.jpg
Line 132 will always be true and NotFound will be thrown. If i set $valid to true manually it will work.
Comment #12
cilefen commentedFrom a triage perspective, getting the answers to the following will help:
Comment #13
marcoka commentedI close this. I bet it is some contrib again.
Comment #14
marcoka commentedComment #15
larowlanDid you happen to update pathologic too?
if so make sure it is running before your media embed filter, this hit me too
Comment #16
larowlan#2993935: Support for srcset attribute
Comment #17
marcoka commentedI did not yet, but i see there is an update. Will try that now and report back.
larowlan THANK YOU SOOO MUCH. You are my hero of the month :)
I would never have found out this but the update/removing the filter fixes the problem. Debugging even with xdebug isnt easy these days. Found out why it will not work but not where it comes from.