uri_prefix add an unwished "/" in the beginning of files' url if directory namer already begin with a "/".
Current behavior
Using directory_namer, uri_prefix add a "/" in beginning, resulting to something like //path/to/file.jpg and is wrong (like in vich uploader field in form). Need to set uri_prefix to 'uploads/..' to prevent it or change the directory namer to send a string not beginning by a "/"
How to reproduce
use directory_namer :
vich_uploader:
db_driver: orm
storage: flysystem
mappings:
media:
uri_prefix: '' # 'uploads/..' is a working temp fix
upload_destination: oneup_flysystem.default_filesystem_filesystem
namer: Vich\UploaderBundle\Naming\SmartUniqueNamer
directory_namer:
service: vich_uploader.namer_directory_property
options: { property: "directory", transliterate: false }
// Entity\Media.php
class Media
{
private ?string $directory = '/uploads/medias/';
[...]
// ##################### Custom methods #####################
public function getDirectory(): ?string
{
return $this->directory;
}
}
Expected behavior
Default uri_prefix should handle if directory namer already begins by a "/".
Bug Report
Summary
uri_prefix add an unwished "/" in the beginning of files' url if directory namer already begin with a "/".
Current behavior
Using directory_namer, uri_prefix add a "/" in beginning, resulting to something like
//path/to/file.jpg
and is wrong (like in vich uploader field in form). Need to set uri_prefix to 'uploads/..' to prevent it or change the directory namer to send a string not beginning by a "/"How to reproduce
use directory_namer :
Expected behavior
Default uri_prefix should handle if directory namer already begins by a "/".