Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using module Feeds Image Grabber (https://www.drupal.org/project/feeds_imagegrabber). It was working, but since release of version 7.x-2.0-alpha9 Feeds module, it no longer works.
It throws me error: ex. "The file_name.pngitoknn9ipbkQ has an invalid extension." (of course itok string is always different).
I am sure that a following fix in the latest release "#1848498 by twistor: Respect allowed file extensions in file mapper" causes the issue. I think that it should be fixed.
Comment | File | Size | Author |
---|---|---|---|
#17 | feeds-remove_query_string-2510788-17.patch | 1.68 KB | joaogarin |
#7 | feeds-remove-query-2510788-7.patch | 2.44 KB | twistor |
#3 | feeds-remove-query-2510788-3.patch | 1.7 KB | twistor |
Comments
Comment #1
twistor CreditAttribution: twistor as a volunteer commentedYup, that is a bug, but, it existed before the patch, we just weren't as strict.
As an iterim fix, you can strip the token from the URL with feeds_tamper.
Can you tell me what the URL looks like it the feed?
Comment #2
iamfredrik CreditAttribution: iamfredrik commentedI have a similar issue with 7.x-2.0-alpha9. I'm importing feeds from Facebook using Feeds_ex JsonPath parser and importing images from urls with query strings fails without showing any error messages. I'm not using Feeds Image Grabber, I tested it, but could not get it to work at all.
Stripping the tokens using feeds_tamper cannot be done, because that removes access to the images.
Downgrading Feeds to 7.x-2.0-alpha8 fixed the problem!
Comment #3
twistor CreditAttribution: twistor as a volunteer commentedComment #4
twistor CreditAttribution: twistor as a volunteer commentedComment #6
Tom1899 CreditAttribution: Tom1899 commentedThere is also another issue. If file has extension in uppercase ex. JPG instead of jpg, then it is not working too.
Comment #7
twistor CreditAttribution: twistor as a volunteer commentedYup.
Comment #9
twistor CreditAttribution: twistor as a volunteer commentedComment #10
solucioteca CreditAttribution: solucioteca commentedThank you @twistor. Work for me
Comment #13
twistor CreditAttribution: twistor as a volunteer commentedComment #15
joaogarin CreditAttribution: joaogarin commentedHello,
I am trying to import images using feeds from another CMS. I am running in an issue where removing the query string is causing some issues as in this CMS I do need the query string in the URL.
As feeds removes it the images can not be fetched. I think its a Microsoft CMS and despite the image url not being ideal (it uses the query string) that is how it works. Also feeds should probably just use just some better method like running the image through image_get_info() instead of relying on the image name or format.
best regards
Joao Garin
Comment #16
joaogarin CreditAttribution: joaogarin commentedComment #17
joaogarin CreditAttribution: joaogarin commentedI am proposing a patch here to roll back this to the previous state. Since this breaks the current site I am working on. Probably others as well.
Best regards
Joao Garin
Comment #18
twistor CreditAttribution: twistor as a volunteer commentedHow is this breaking things? Removing the query string only happens for the local file name, not the URL used to fetch the file.
Comment #19
joaogarin CreditAttribution: joaogarin commentedHello,
No this affects files being fetched outside Drupal.
In lines 457 of FeedsParser.inc :
getLocalValue() function calls getSafeFilename() which has these lines in the patches.
Best regards
Comment #20
kenorb CreditAttribution: kenorb commentedProbably related: #2611014: Feeds doesn't import remote images which have no proper extension (such as ASP)
Comment #21
joaogarin CreditAttribution: joaogarin commentedYes @kenorb I am thinking they are probably related.