- Issue created by @RedwanJamous
- last update
over 1 year ago 1 pass - @redwanjamous opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:44pm 6 July 2023 - Status changed to RTBC
4 months ago 1:52pm 4 August 2024
When trying to use a local image from inside a module, a directory named ":" will be created and the resized image will be copied there. If there's no write permission to that directory, the following exception will be thrown.
Drupal\Core\Entity\EntityStorageException: The specified file 'modules/custom/my_module/images/logo.png' could not be copied because the destination directory '://resize' is not properly configured. This may be caused by a problem with file or directory permissions. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
This is because the scheme is missing from $image['destination']
.
Instead of returning an empty value for $path_info['scheme']
when the image's path doesn't match any stream wrapper, we can fallback to the default scheme.
1.0
Code