Closed draghu9 closed 1 month ago
I'm unable to replicate this.
Is your webserver running Windows?
Could you try updating vendor/silverstripe/assets/src/Flysystem/PublicAssetAdadter::getPublicUrl()
to the following:
public function getPublicUrl($path)
{
$path = Convert::slashes($path, '/'); // this line is new
return Controller::join_links(Director::baseURL(), $this->parentUrlPrefix, $path);
}
And let me know if that fixes the issue?
I have done the changes as you mentioned, and it seems to have fixed the issue. Also Yes, my web server is running on Windows
PR merged. This will be automatically tagged by GitHub actions.
Module version(s) affected
2.2.0
Description
Silverstripe Framework version 5.2.6 Asset admin version 2.2.0 Operating in clean Silverstripe install with no customizations
Uploading images in the CMS Files system is working but thumbnails are not showing up upon Publish. This is happening at the sub directory level. Example If we create a folder structure in Files as Files->Level1->Level2->Level3 and Upload an image at directory Level 3 and publish the thumbnail is missing.
I have checked the image src and the problem seems to be missing forward slashes (/) that separates the sub directories. Adding the forward slashes in the path via Inspect Element showed me the thumbnail.
Following GIF should represent what I mentioned above.
How to reproduce
Possible Solution
Navigating through the code I found there is a function called generateThumbnailLink(AssetContainer $file, $width, $height, $graceful = false) in ThumbnailGenerator.php file.
$result = $this->generateLink($thumbnail); gives the missformed thumbnail URL with all backslashes adding str_replace("\","\/",$result); seems to resolve the issue.
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs