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.
Drupal does not accept settings uppercase image file extensions, such as JPG.
So when Feeds try save file by url this function give us fatal error and script is fall:
protected function getFileName($url) {
$filename = trim(drupal_basename($url), " \t\n\r\0\x0B.");
$extension = substr($filename, strrpos($filename, '.') + 1);
if (!in_array($extension, $this->fileExtensions)) {
throw new TargetValidationException('The file, %url, failed to save because the extension, %ext, is invalid.', ['%url' => $url, '%ext' => $extension]);
}
return $filename;
}
Propose replace it with this patch allow_import_image_with_uppercase_extensions__for_example_JPG.patch
Comment | File | Size | Author |
---|---|---|---|
#5 | feeds-uppercase-file-ext-2848792-4.patch | 6.32 KB | MegaChriz |
| |||
#5 | feeds-uppercase-file-ext-2848792-4-tests-only.patch | 5.67 KB | MegaChriz |
Comments
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThe status 'RTBC' is only for meant for patches that have been thoroughly tested and the status should in most cases only be set by someone else than the patch author. See the documentation about setting this issue status: https://www.drupal.org/node/156119#rtbc
I set this to "Needs work" now, because you are removing the throw of an exception here, which is there for a good reason. If it causes a fatal error, then code further down the calling stack is broken. Somewhere this exception should be catched. See http://php.net/exceptions for information about what exceptions are. The following on that page is what I meant about catching exceptions:
Comment #3
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedSimilar issue: #2772595: When mapping to File or Image fields, empty source for target_id causes Exception and breaks import process.
Comment #5
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThis patch should fix the issue. The tests only patch demonstrates the bug.
Comment #8
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedCommitted #5.