silverstripe / silverstripe-assets

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

Draft Image not shown when previewing the page #499

Closed mark-a-j-adriano closed 2 years ago

mark-a-j-adriano commented 2 years ago

Summary: As a user with 'Previewers' [VIEW_DRAFT_CONTENT] access, I want to view all content on a draft web page.

Currently, they cannot see any images that are not published.

Scenario 1:

Expected: Preview of the page will show the draft content + image Actual: Preview of the page will show the draft content without the draft image Note : When I go in as Admin and edit the page (wait for it to load the image in the CMS) then try to preview the page again then the image shows up. (like a pre-warm procedure maybe?)

Scenario 2:

Scenario 3:

Modules installed: "name": "silverstripe/cms", "version": "4.8.0", "name": "silverstripe/framework", "version": "4.8.0", "name": "silverstripe/sharedraftcontent", "version": "2.5.1", "name": "silverstripe/assets", "version": "1.8.0",

Screen Shot 2022-07-04 at 11 25 56 AM
GuySartorelli commented 2 years ago

In all of these scenarios, the user who created the page is an admin. Is this also a problem if someone with less-than-admin privileges creates the page?

mark-a-j-adriano commented 2 years ago

@GuySartorelli -> Yep, I used a Content Author and the same issue as above. Roles included : Screen Shot 2022-07-07 at 12 32 03 PM

emteknetnz commented 2 years ago

Note our cucumber test for share draft content did not include an image for the test - I've updated this now

This seems a little weird to be honest - we have made a couple of bugfixes in the last year or so that have touched the file grant logic, I wonder if one of those would have resolved this.

@mark-a-j-adriano I noticed you're running 4.8 - could I get you to double check this on a more recent version of silverstripe?

composer create-project silverstripe/installer:^4.11 and composer require silverstripe/sharedraftcontent:^2.7 and then see if you're able to replicate the issue above

mark-a-j-adriano commented 2 years ago

@emteknetnz -> looks like working for all scenarios for the latest cms and share draft content modules. Looks like this is more pushing clients to update to the latest modules then.

emteknetnz commented 2 years ago

Great to hear, thanks for taking the time to report and replicate this issue. I'll close this one.