Open normann opened 5 years ago
If Step 5 is not considered as a failure, i.e. this is supposed behavior by SS4.4, at least Step 10 should be considered as a failure, right? An old URL bookmarked by site user should either redirect to the new URL or load with the new file content.
The issue might be better logged on the https://github.com/silverstripe/silverstripe-asset-admin repo.
Yes, noticed that after the creation of the issue :) @michalkleiner
I think I will manage to migrate the issue to either SilverStripe-asset-admin
or SilverStripe-assets
(now they are separated), will ask SilverStripe though.
I'd say this probably belongs in assets, not asset-admin. The administration screens are being used correctly but the URLs generated to serve the assets are wrong - which implies it's assets
. I'll move it for you.
Not quite sure how to rank the impact of this issue yet - I haven't had an opportunity to look into it.
@ScopeyNZ thanks.
Could you migrate another issue to be under silverstripe-assets
https://github.com/silverstripe/silverstripe-framework/issues/9141 which I think more serious
In terms of impact, I think this is limited to intranet-style SilverStripe usage where the intranet isn't IP whitelisted, but rather protected via CanView=LoggedInUsers
on Page and File records. Since you could achieve this via silverstripe/securefiles
in 3.x already, and that module is part of CWP, there will be existing 3.x users who are used to hotlinking to those files. When upgrading to 4.x, those hotlinks break. The short answer is that you should access protected files via a page that's listing them, but of course users will bookmark/share whatever URL they get in the browser for the file.
So I'd say this is a known limitation, but contributions are welcome. As as starting point, you'd need to look at FlysystemAssetStore->getResponseFor()
, and modify either HashFileIDHelper
or NaturalFileIDHelper
to identify this file, and cause a redirect.
I just experienced the same issue upgrading a SS3 instance to SS4, like @chillu said, it's a private website where the assets are all set to protected.
After upgrading, we had many broken image links in our Content fields, e.g. assets/2017/02/something.jpg
which, after the upgrade, has to be called by assets/2017/02/f365a8dbcf/something.jpg
.
What I noticed in https://github.com/silverstripe/silverstripe-assets/blob/1/src/Flysystem/FlysystemAssetStore.php#L1518
if ($parsedFileID = $publicStrategy->softResolveFileID($asset, $public))
only the public filesystem is searched for the filehash, I was able to mitigate the problem by expanding the condition to
if (
($parsedFileID = $publicStrategy->softResolveFileID($asset, $public)) ||
($parsedFileID = $protectedStrategy->softResolveFileID($asset, $protected)))
Now the filehash is correctly resolved for both public and private assets.
Do you think this would be a valid way to fix this issue?
Affected Version
Replicated in 4.4.1, might be replicable in 4.4.0
Description
Give the fact that version 4.4 is trying to solve the file link dynamically changing due to a hash (to refect file version) in the URL, once the file is replaced by another file where we can see the issue prior to version 4.3 (inclusive), but the fixes or the feature seemed not affecting protected assets
Steps to Reproduce