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.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

marcoka created an issue. See original summary.

marcoka’s picture

That 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.

marcoka’s picture

Status: Active » Closed (cannot reproduce)
marcoka’s picture

Status: Closed (cannot reproduce) » Active
cilefen’s picture

I updated drupal yesterday.

From which version to which version? Did you update Drupal core only?

marcoka’s picture

I 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.

cilefen’s picture

If this is a regression bug it can be solved much faster if we know the versions, which would could derive the steps to reproduce.

cilefen’s picture

You can use https://simplytest.me/ to verify the current behavior of Drupal core.

marcoka’s picture

I 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.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
marcoka’s picture

I 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.

cilefen’s picture

From a triage perspective, getting the answers to the following will help:

  1. Is the replicable with a clean install of Drupal Core alone?
  2. If yes, in which version did the new behavior appear?
marcoka’s picture

I close this. I bet it is some contrib again.

marcoka’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
larowlan’s picture

Did you happen to update pathologic too?

if so make sure it is running before your media embed filter, this hit me too

larowlan’s picture

marcoka’s picture

I 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.