You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Login to CMS running on Silverstripe framework 5.2.6 and Admin-Assets 2.2.0
Navigate to Files section from Left hand menu
Create nested sub-directories. Example Files->Level1Directory->Level2Directory->Level3Directory
Upload an image in Level3Directory
Publish
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
Check that there isn't already an issue that reports the same bug
Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Could you try updating vendor/silverstripe/assets/src/Flysystem/PublicAssetAdadter::getPublicUrl() to the following:
publicfunctiongetPublicUrl($path)
{
$path = Convert::slashes($path, '/'); // this line is newreturn Controller::join_links(Director::baseURL(), $this->parentUrlPrefix, $path);
}
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
The text was updated successfully, but these errors were encountered: