ImageFixtures uses backward slash (\) as directory separator for relative paths in Windows.
Example: stock\image_40672.jpg
This causes problems when using in Vue as a css background-image property (probably parsed as an escape sequence):
stockimage_40672.jpg
Since PHP works the same with paths using / as a separator and since the / is the path separator in URLs, I think we should use it in this case.
To fix this issue I tried to change the separator from the beginning in the origin.
Symfony/Finder uses RecursiveDirectoryIterator wich suports UNIX_PATHS, but Symfony/Finder doesn't allow such configuration.
The next best thing I think is to replace the separator before storing it in the database.
Details
| Question |
Answer |
| Operating System |
Windows |
| Relevant Bolt Version |
4.1 |
| Install type |
Composer install |
| BC Break |
no |
| PHP version |
7.4 |
| Web server |
Built-in |
| For UX/UI issues |
Browser name and version |
Reproduction
Steps to reproduce
- Install bolt
composer create-project bolt/project myproject
- Setup bolt with fixtures (dummy content)
- Start built-in server
bin\console server:run
- Edit any people entry
Expected result
The preview of the image field should be displayed.
Actual result
The preview of the image field doesn't show.
ImageFixtures uses backward slash (
\) as directory separator for relative paths in Windows.Example:
stock\image_40672.jpgThis causes problems when using in Vue as a css background-image property (probably parsed as an escape sequence):
stockimage_40672.jpgSince PHP works the same with paths using
/as a separator and since the/is the path separator in URLs, I think we should use it in this case.To fix this issue I tried to change the separator from the beginning in the origin.
Symfony/FinderusesRecursiveDirectoryIteratorwich suportsUNIX_PATHS, butSymfony/Finderdoesn't allow such configuration.The next best thing I think is to replace the separator before storing it in the database.
Details
Reproduction
Steps to reproduce
composer create-project bolt/project myprojectbin\console server:runExpected result
The preview of the image field should be displayed.
Actual result
The preview of the image field doesn't show.