Bug #15134
closedBroken site image/icon
Added by Colin McDonald almost 3 years ago. Updated almost 3 years ago.
0%
Description
See attached screenshot. I don't have access to this site, but maybe there's an upload or file format issue keeping the icon from displaying? And maybe there's a way to recognize this and show one of Sara's placeholder icons instead? Here's the site:
Files
broken-site-icon.png (61.4 KB) broken-site-icon.png | Colin McDonald, 2022-01-04 01:49 PM | ||
broken image.png (122 KB) broken image.png | Colin McDonald, 2022-01-05 05:00 PM |
Related issues
Updated by Raymond Hoh almost 3 years ago
When a site icon is uploaded, it is uploaded to that site's file space.
The issue here is that specific site is private and we have custom permissions for files uploaded to private sites, causing that site icon not to display (see #7997). We might have to mirror private site icons to the main site and add some custom code to BuddyPress in order for those site icons to display properly.
Boone, do you have any other suggestions?
Updated by Raymond Hoh almost 3 years ago
Actually, we shouldn't be showing private sites in the "Site across CUNY" block to begin with.
Looking into this.
Updated by Boone Gorges almost 3 years ago
I was just in the process of saying the same thing :) Thanks, Ray.
Updated by Raymond Hoh almost 3 years ago
- Related to Bug #14223: Non-public site visibility change should update all related site activity visibility to hidden added
Updated by Raymond Hoh almost 3 years ago
- Category name set to BuddyPress (misc)
- Status changed from New to In Progress
- Assignee set to Raymond Hoh
- Target version set to 1.19.1
The "Sites Across CUNY" block is powered by the BuddyPress activity component. The query looks for public activity items that are either with the 'new_blog', 'new_blog_post', or 'new_blog_comment' type.
The ccnyparasites
site is private, however the related 'new_blog'
activity item is public. #14223 addressed switching over the 'new_blog_post' and 'new_blog_comment' items to hidden, but not the 'new_blog' one. I've just added a fix for this here: https://github.com/cuny-academic-commons/cac/commit/634380add027bc14a86a72f2bca5f3627693b872.
I'm also running a query to fix all the older 'new_blog' activity items that are public, but need to be hidden.
Boone, this is the DB query I ran to determine the ones that need to be switched over:
SELECT a.id FROM wp_bp_activity a LEFT JOIN wp_blogs wb ON (a.item_id = wb.blog_id) WHERE a.type = 'new_blog' AND a.hide_sitewide = 0 AND a.primary_link like '%.commons.gc.cuny.edu%' AND wb.public < 1;
This returns 8748 'new_blog' activity items that need to be switched to hidden. Will update the ticket once the script is done.
Updated by Raymond Hoh almost 3 years ago
- Status changed from In Progress to Staged for Production Release
Script just finished running.
Updated by Colin McDonald almost 3 years ago
- File broken image.png broken image.png added
Before closing this out, see screenshot for another broken site image I just noticed on the Site Directory, no placeholder image shown. This is the site:
Updated by Raymond Hoh almost 3 years ago
Before closing this out, see screenshot for another broken site image I just noticed on the Site Directory, no placeholder image shown.
For this specific instance, the site is public and previously had a site icon. However, sometime later, an administrator removed the site icon manually from the Media Library and did not replace the site icon with another one. Currently, BuddyPress does not detect manual site icon removals from the Media Library. Thus, the corresponding site icon URL meta values that BuddyPress references were never removed. This results in the broken site icon image for the site.
The typical way to remove the site icon is via the Customizer and BuddyPress will detect site icon removals that way, so this is an edge-case.
Anyway, I've just added a fix to wipe out the site_icon
option value when a site icon is deleted from the Media Library. See https://github.com/cuny-academic-commons/cac/commit/c4d0cb85d5b930db0e6dffbee987f122196a9647. (After committing the fix, I found a related ticket on WordPress Trac about this issue: https://core.trac.wordpress.org/ticket/49086 .) I've also removed the site icon meta values manually for the casd1643levy21
site, so we should be good to close this issue.
Updated by Colin McDonald almost 3 years ago
Thanks for the attention to detail on this one, Ray!
Updated by Boone Gorges almost 3 years ago
- Status changed from Staged for Production Release to Resolved