Images coming up blank in Media Library
Via ZD, Benjamin Swett writes:
"On a cloned site, new images I try to upload to the media library are coming up blank in the media library and I am unable to use them as new site headers. Am I doing something wrong or is there something wrong with this cloned site? Thanks so much for your help."
The site is https://humansandanimalscompositionfall2022.commons.gc.cuny.edu/. I attach an image of the empty items. LMK what else would be helpful. Thanks!
Updated by Raymond Hoh 3 months ago
- Category name set to Site cloning
- Status changed from New to Staged for Production Release
- Assignee set to Raymond Hoh
- Target version set to 2.0.2
I was able to determine the problem. I've fixed the issue on the
humansandanimalscompositionfall2022.commons.gc.cuny.edu site by removing an
.htaccess file that shouldn't have been cloned to the new site's upload directory.
I've added Jeremy and Boone as watchers.
The issue is due to cloning a private site. For private sites, we add an .htaccess file to the site's upload directory to prevent hotlinking to the media asset for non-logged-in users. When a private site is cloned, it also copied the previous site's
.htaccess file, which caused the broken images and wrong redirection to the previous site.
To fix this, I opted to delete the new
.htaccess file if it was cloned from the previous site and re-generating the
.htaccess file if the new site is private after the initial attachments are copied over: https://github.com/cuny-academic-commons/cac/commit/89c02e35658223372edfac26927e57074bc914bd
I'm not sure how many cloned, private sites are affected by this. We should have heard more reports if that were the case.