Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Drupal version: 7.14
Insert module: 7.x-1.1
When the "Insert" button is clicked, with a style different to thumbnail or original (medium for example), a "Clean URL" is pasted in the HTML editor:
http://www.mydomain.com/sites/default/files/styles/medium/public/image.png
If the image has not already been created, it will give a broken image. The "Clean URL" should NOT be used:
http://www.mydomain.com/?q=sites/default/files/styles/medium/public/image.png
The parameter "?q=" force Drupal to create the image if it doesn't exists.
Comment | File | Size | Author |
---|---|---|---|
#4 | insert_no_clean_urls.patch | 1.89 KB | quicksketch |
Comments
Comment #1
gaellafond CreditAttribution: gaellafond commentedPATCH
image.inc
Line: 50
ACTUAL CODE
Calling "image_style_url" create the URL, not the physical image. The BUG can be fixed by using the returned URL instead of crafting one using the homemade function "insert_create_url".
PATCHED CODE
Comment #2
quicksketchSo summary: Insert uses the wrong path when using not-Clean URLs.
I think we need to keep using insert_create_url() to make it so that the $absolute option is still obeyed, but you're right that we need to check if the file exists or not before trying to use a non-clean URL.
Comment #3
quicksketchComment #4
quicksketchI've committed this patch modeled on image_style_url() that should fix this problem.
Comment #5.0
(not verified) CreditAttribution: commentedClarification about the difference between the 2 URLs