silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
9 stars 65 forks source link

Shortcode are not being cached #597

Closed maxime-rainville closed 2 months ago

maxime-rainville commented 2 months ago

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 and ImageShortcodeProvider 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

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

Pull request

GuySartorelli commented 2 months ago

@maxime-rainville Please link to any revelant PRs since this is in the peer review column

maxime-rainville commented 2 months ago

Added a link to PR https://github.com/silverstripe/silverstripe-assets/pull/598

GuySartorelli commented 2 months ago

PR merged. Will be automatically tagged by GitHub actions