Multiple image transform query strings in asset url
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 47
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Description
I've enabled images with transforms for use within a rich text field. The available transforms are defined in Craft's asset settings. The image displays fine within the control panel, but when viewing on the frontend there are two query param strings appended to the asset's url which returns a 500. If I remove the second query param string, the image is found so it seems my host Servd is correctly transforming the image. Wondering why a second transform string is being appended and how to resolve.
baseImageUrl.jpg?w=200&h=150&q=90&auto=format&fit=crop&dm=1732631447&s=c5d824714c4852eb8495f30cbe6d7d62?w=200&q=90&auto=format&fit=crop&dm=1732631447&s=b143f59c284e705261b7fe6957ffe904
// first transform query string
?w=200&h=150&q=90&auto=format&fit=crop&dm=1732631447&s=c5d824714c4852eb8495f30cbe6d7d62
// second transform query string
?w=200&q=90&auto=format&fit=crop&dm=1732631447&s=b143f59c284e705261b7fe6957ffe904
Steps to reproduce
- Add asset in a rich text field, apply a defined transform.
- View entry on the frontend and the image is broken.
Additional info
- Craft version: Craft Pro 5.5.5
- PHP version: 8.2
- Database driver & version: MySQL 28.1
- Plugins & versions: CKEditor 4.4.0
- Deployed on Servd
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction steps and inspect how CKEditor rich text content generates the frontend asset URL for a defined transform. Compare the URL produced in the control panel with the frontend output and trace where the second query string is added. Done means the frontend image URL contains one valid transform query string and no longer returns a 500 on Servd.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100