If I understand correctly, Imagecache token module finds all file fields and creates imagecache style tokens for them. However, some file field types are not images, and this can cause confusion for those fields.
For example, I have the media_youtube module installed which creates a youtube file type associated with a youtube url.
After installing imagecache_token, these youtube file fields have image style tokens listed for them. Of course, they don't work.
The uri's associated with these files are youtube uri's, not images. When rendered, the call to image_style_url falters, and the output is just the query string token (e.g. "?itok=u4sSj3FE")
Imagecache tokens should probably only be generated for image file types, but I'm not sure to differentiate between all the possible file field types.
Comment | File | Size | Author |
---|---|---|---|
#22 | imagecache_token-n2407461-21.patch | 761 bytes | DamienMcKenna |
#19 | imagecache_token-n2407461-19.patch | 366 bytes | DamienMcKenna |
#18 | imagecache_token-n2407461-18.patch | 465 bytes | DamienMcKenna |
#11 | imagecache_token-n2407461-11.patch | 5.5 KB | DamienMcKenna |
Comments
Comment #1
travelerttI'm having the same problem with my site after I enabled this module. I had to disable it because it was effecting all of my file fields. This module should only be affecting image type files in my opinion.
Comment #2
travelerttLooks like the change in the commit is causing the problems. I undid the patch on my site.
https://www.drupal.org/node/2365049
Comment #3
travelerttHere is a patch to remove file field type tokens.
Comment #4
DamienMcKennaThere are many sites that use the 'file' field for adding images. Rather than disabling support for these, it'd be better to check the mimetype for file fields and only support images.
Comment #5
DamienMcKennaComment #6
amaisano CreditAttribution: amaisano commentedJust ran into this. Whenever this module is enabled, it thinks all my file fields are images. What's worse is using a token for [...:field_myfile:path] results in a default/files/styles/path, which is incorrect if it's a regular document upload.
Comment #7
DamienMcKennaThis adds a settings page so you can control which File and Media fields will have the tokens.
Comment #8
deanflory CreditAttribution: deanflory as a volunteer commentedThanks Damien, will check it out.
Comment #9
deanflory CreditAttribution: deanflory as a volunteer commentedDamienMcKenna, the patch in #7 either causes an error or reveals an underlying error. Sorry I'm not adept at module coding to know what is going on, but someone else had filed an error issue with Context that matched the error I was experiencing.
Any chance someone could take a look at it?:
#2532084: DB error when loading a context with menu reaction with Context v3.3 and v3.5+
https://www.drupal.org/node/2532084
I'm adding it as a related issue just in case that helps someone find the right solution eventually.
Comment #10
DamienMcKennaI closed #2532084: DB error when loading a context with menu reaction with Context v3.3 and v3.5+ because that bug was being caused by this patch.
Comment #11
DamienMcKennaI caught the error - I made a mistake on the info file X-) This patch should fix it.
Comment #12
DamienMcKennaCommitted.
Comment #15
DamienMcKennaComment #16
deanflory CreditAttribution: deanflory as a volunteer commentedThanks for the time and effort Damien!
Comment #17
nickcontino CreditAttribution: nickcontino commentedI updated to this release, but its not saving the options under admin/config/media/imagecache-token
I click the fields I want, and hit save. I get the usual "The configuration options have been saved.", but then all checkboxes are unchecked, and I'm unable to use the tokens.
Comment #18
DamienMcKennaWhoops! Forgot to add the #default_value to the form field. Thanks for noticing, nickcontino.
Comment #19
DamienMcKennaAnd this patch adds hook_uninstall() to remove the variable.
Comment #20
DamienMcKennaCommitted.
Comment #22
DamienMcKennaOne more issue - always support image fields. Duh.
Comment #23
DamienMcKennaCommitted.