Silverstripe Version: 5.2
Question:
I’m using static publisher to build a full cache of all relevant pages (eg. forms etc are excluded). The uncached pages all view fine on both desktop and mobile views (iPhone), yet when I view the generated cached pages, none of the images load on iPhone, yet are displaying normally on desktop.
Note that I have a responsive layout, which resizes based on screen size, the same image url is used in either case.
Any ideas on what might be causing this or how to get to the bottom of it are most welcome?
Ok, so it appears that I was simply logged out on my phone while viewing the page. Once logged in, the images appear.
However, the problem remains that I can’t seem to get the images to display (to logged out users / non-members), even if I change the permissions settings on both the parent folder and individual images - I get a 404 error on each image. If I delete the cache, the images display fine, even when logged out.
Looking at the file structure (in eg. cPanel FileManager), I can see that the parent folder name (eg. Banners) is still inside the assets/.protected folder and each file inside Banners is still inside its protected file hash folder (despite updating permissions in the CMS). As all these files and folders were created and uploaded via Pages using UploadField setFolderName(), the problem will also reoccur once a user adds any new files to pages. Why are the images not being made available once the pages are published?
What am I missing?
This didn’t appear to be an issue on SilverStripe 4.13, only since I upgraded to SIlverStripe 5.2.
If I publish a page that contains images, they remain inside their protected hash folders - they do not get moved to public assets (as described here: https://docs.silverstripe.org/en/5/developer_guides/files/file_security/#how-file-access-is-protected). I have file ownership set where applicable, so when I publish a page, it also publishes the images it uses.
Is this a bug or am I missing a critical setting somewhere?