Fixed
Details
Assignee
Michael Sultzaberger
Michael Sultzaberger(Deactivated)Reporter
Jason Elwood
Jason ElwoodLabels
Components
Fix versions
Priority
Created November 10, 2015 at 2:55 PM
Updated April 4, 2016 at 8:13 PM
Resolved November 13, 2015 at 3:53 PM
The print process fails when the program code associated with the plan doesn’t match a program code in external_program. This occurs when the program_code is manually entered instead of selecting from the combo box or the previously selected value no longer exists in external_program. This query identifies "orphaned" rows.
——
select p.first_name, p.last_name, p.school_id, m.name, m.program_code from person p
join map_plan m on p.id = m.person_id
where m.object_status = 1
and m.program_code != ''
and m.program_code not in (select distinct code from external_program)
order by m.program_code
——
The software solution might be complicated. The program selection when saving a plan is a combo-box, but a value can be entered. Any value entered will definitely fail. We could restrict entry into that box; we have it other places already. That seems like a no-brainer. However, that doesn’t fully solve the problem because the external_program value is copied to the plan definition when saving. If the saved value no longer exists in external_program in the future, the error will occur when attempting to print because the program_code is used to look up the program name from external_program.
The blunt force approach would be to remove the requirement to resolve the map_plan.program_code value.