Closed maxime-rainville closed 6 months ago
@maxime-rainville Please link to any revelant PRs since this is in the peer review column
Added a link to PR https://github.com/silverstripe/silverstripe-assets/pull/598
PR merged. Will be automatically tagged by GitHub actions
Module version(s) affected
2.2.0, but probably all version of 2
Description
The method that's meant to check the cache for
FileShortcodeProvider
andImageShortcodeProvider
will always return an empty string unless you allow session grant.In CMS4, I think session grant was enabled by default so this wasn't a problem.
https://github.com/silverstripe/silverstripe-assets/blob/ff5e8a743eea9cdddb900579a6e8c3d77a48e8ba/src/Shortcodes/FileShortcodeProvider.php#L137-L150
How to reproduce
die('cache hit');
statement in thisif
clause https://github.com/silverstripe/silverstripe-assets/blob/ff5e8a743eea9cdddb900579a6e8c3d77a48e8ba/src/Shortcodes/ImageShortcodeProvider.php#L59-L64.Expected results: I hit the die statement. Actual: My cache check always returns a blank string and I regenerate the short code each time.
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)Pull request