Bug #23494
closed"Sites From Your Campus" lists a site from a different campus
0%
Description
I'm at Hunter. Under "Sites From Your Campus" on https://commons.gc.cuny.edu, I get a site called WKRB 90.3 FM. That site appears to be from Kingsborough.
Files
Updated by Raffi Khatchadourian 4 months ago
Ah, but I'm also "at" the GC. Could this site be from the GC as well?
Updated by Raymond Hoh 4 months ago
- Category name changed from User Experience to Home Page
- Assignee changed from Chris Stein to Raymond Hoh
Thanks for the report, Raffi. I just checked the profile data for your account and it looks like your College field was unset. I've just set it to Hunter College.
Let me know if you are able to see suggestions from Hunter under the "Sites From Your Campus" block on the homepage.
Updated by Raymond Hoh 4 months ago
Boone, I checked a few Extended Profiles of some of our team and it seems that the "College" field is blank.
There might be a deeper problem here.
Updated by Boone Gorges 4 months ago
I haven't had a chance to look yet, but if the field pulls from 'College', that's probably the problem. I believe we should be looping through 'positions'.
Updated by Raymond Hoh 4 months ago
Ah that makes sense. I have to make some adjustments to the cac-suggestions plugin to account for the Positions field as the plugin was originally coded to look at the College field.
Updated by Boone Gorges 4 months ago
Ah, right, cac-suggestions powers this. 'Positions' has migrated a few times in the history of the Commons but I think that it's the "canonical" way to determine campus affiliations. Check out how cac-cv-editor mirrors "positions" data: https://github.com/cuny-academic-commons/cac/blob/187bb63074607221f8f2a6a24e789b899a66ada5/wp-content/plugins/cac-cv-editor/blocks/src/cv-positions/index.php#L24
Actually, looking this over, it looks like it should be putting it into field 2, which is 'College'. So this probably will need some more investigation. Maybe something else in the system is overwriting or wiping 'College'. I don't have time to investigate right now - it'll have to wait until after my time away, unless you want to dig in before that.
Updated by Raffi Khatchadourian 4 months ago
Raymond Hoh wrote in #note-2:
Thanks for the report, Raffi. I just checked the profile data for your account and it looks like your College field was unset.
Hm. I'm sure I've set that before at some point. Also, the "People" suggestions seem to work fine; it was just the "Sites" that I noticed.
Updated by Raffi Khatchadourian 4 months ago
Raymond Hoh wrote in #note-2:
Thanks for the report, Raffi. I just checked the profile data for your account and it looks like your College field was unset. I've just set it to Hunter College.
Where is this field supposed to be set? I don't see it in the settings of my profile.
Updated by Raymond Hoh 4 months ago
- Target version set to 2.5.16
Actually, looking this over, it looks like it should be putting it into field 2, which is 'College'. So this probably will need some more investigation.
Looks like the College syncing method looked for the campus slug, where it should be looking at the campus full name. I've addressed this in https://github.com/cuny-academic-commons/cac/commit/c58c975255d90870634d80f451755fdc3c43ad61 and pushed this to production.
We'll probably have to write a script to sync the cacap_position_college user taxonomy cv-positions block data from a user's CV to the College xprofile field. I'll leave this ticket open for that.
Where is this field supposed to be set? I don't see it in the settings of my profile.
The 'College' field is an older, internal profile field used during the registration process. You will not see this on your Account Settings page. However, we do update the 'College' field whenever the CV's Positions block is updated or saved. This syncing portion of the CV was broken. Your report helped us uncover this bug, Raffi, so thanks for that.
Updated by Boone Gorges 4 months ago
Ray, thanks for tracking this down and fixing my error.
I built a sync script, and a dry run confirms your hypothesis. The vast majority of users with a CV do not have the 'College' field set - this makes sense because of the slug/full_name mismatch when checking against the cac_get_cuny_campuses() whitelist. The only users who both have a CV and also have the College field are those whose CVs don't have a 'positions' block - thus no overwriting took place.
In the script, I've opted only to be additive: if any legacy user already has College values set, I leave them alone.
Would you mind looking over the script before I run it?
Updated by Raffi Khatchadourian 4 months ago
Silly issue here, but, should I not be a "Member From My Campus?"

Updated by Raymond Hoh 4 months ago
Would you mind looking over the script before I run it?
Script looks good, Boone. Feel free to run it when ready.
Silly issue here, but, should I not be a "Member From My Campus?"
The logged-in user is omitted from the "Members From Your Campus" section.
Updated by Boone Gorges 4 months ago
- Status changed from New to Resolved
Thanks, Ray! I've run the script and done some spot-checks - it looks like the data was filled as expected.
Updated by Raffi Khatchadourian 4 months ago
Raymond Hoh wrote in #note-12:
Silly issue here, but, should I not be a "Member From My Campus?"
The logged-in user is omitted from the "Members From Your Campus" section.
Should it then also be omitted from the "Members Across CUNY" section?
Updated by Raymond Hoh 4 months ago
Should it then also be omitted from the "Members Across CUNY" section?
It could. Would have to query for seven members in this block instead of six and if the logged-in user is part of the first six, we omit the user from the section and add the seventh one to the list.
Colin, can you add this to our agenda for our next meeting?
Updated by Raffi Khatchadourian 4 months ago
Another thing I thought of, if your campus is blank, should you be seeing panes regarding "your campus?" In such cases, I would only expect to see panes "across CUNY."
Updated by Raymond Hoh 4 months ago
Another thing I thought of, if your campus is blank, should you be seeing panes regarding "your campus?" In such cases, I would only expect to see panes "across CUNY."
The "Your Campus" blocks are dynamically pulled when you scroll down the page. It might be possible to do something with javascript when there are no suggestions to expand the layout of the "Across CUNY" blocks across the page. We might look into this in a future maintenance release.