Repository navigation
Institution roster: count a mentored student as Current even when her report isn't joined - #226
Conversation
There was a problem hiding this comment.
Thanks @4thhubbard , and yes, I am fine with reversing the call. The school's question is "does my student have a mentor", and the request card and the reconciliation link already treat the mentor link on the Students row as the assignment, so grouping on the joined report alone was answering a different question. I ran all 106 suites on the branch and they pass.
I am merging this and following it on trunk with 1.117.4, cut from the source repository so the next release push cannot overwrite it. That release carries this PR plus:
- Administrators Dashboard, Mentors column. It counts distinct mentor names, and the name only arrives through the reports join, so a mentored student the join missed read as "1 in progress, 0 mentors, 0 waiting". A nameless assigned mentor now counts as one mentor of her own; the index carries no mentor ID.
- One predicate.
WPCPM_Roster_Index::is_waiting()is whatgroups()and the Administrators count both read, so the two screens cannot drift apart again. The Administrators Dashboard suite now pins thehas_mentorcase, which nothing pinned before. - Wording. The mentor cell said the report record "has not been created yet", which is untrue in exactly this case: it exists, the join missed it. It now says "has not reached this page yet". The Current note names both signals, since a row with a report record but no mentor link left on the Students row is still Current.
- Release hygiene. Version, changelog, the translation template, and design spec 7.5, which still defined Current by the report alone.
The data fix for the reported student stands as you describe it: align her email across Students and Students Reports, or remove the duplicate Students row, and the next sync puts her hours and her mentor's name on the roster as well. 1.117.4 is built and ready to deploy.
…gh the email join found no report record Follows #226 (fixes #222) with the release cut from the source repository: the one predicate WPCPM_Roster_Index::is_waiting() read by the roster's groups() and the Administrators Dashboard's count; the Mentors column counts an assigned mentor whose name the reports join never brought; the mentor cell says the report record has not reached this page rather than that it was never created; the group notes name both signals; design specs 7.5 and the Administrators table row; the Administrators Dashboard suite pins the has_mentor case; version, changelog, translation template. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@CeliGaroe, for context on what this changes for the program team:
|
|
Thank you @maciejpilarski! |
Fixes #222.
The Institution Dashboard put a student under "Waiting for a mentor" while her own profile showed her mentor.
Cause.
WPCPM_Roster_Index::groups()split Current from Waiting only onreports, the Students Reports rows the students sync joins to a Students row. That join is by email alone (join_students_rows()). When the two tables hold different addresses for the student, or her address is on a second Students row filed under another institution,reportsstays empty. The mentor is still on the Students row (has_mentor), and the student card reads the reports row directly, so the two screens disagree.Change.
groups(): a tracked current student is Current when she has a mentor or a report record, and Waiting only when she has neither.This reverses a deliberate choice: the old tests pinned a mentored student with no report record under Waiting. @maciejpilarski, please confirm you're OK with that before merging.
Tests.
bin/test-students-sync.phpthat runs the real sync with mismatched addresses and checks the student lands in Current.test-institution-roster-view.php,test-institution-export.phpandtest-institution-roster.phpupdated for the new rule.bin/test-*.phpsuites pass.The data fix for the Liceo La Paz student is separate: align her email across Students and Students Reports, or remove the duplicate Students row.
🤖 Generated with Claude Code
https://claude.ai/code/session_012s7S18Xzuq6cbbeysJ5XFY