slco-2016 / clientcomm

A communications platform for case managers in the Criminal Justice System.
https://clientcomm.org/
Other
10 stars 3 forks source link

Template attempting to render undefined variables #315

Closed kuanb closed 7 years ago

kuanb commented 7 years ago

Looks like when I modified a clients find by org-esque method (or something like that from our model level refactors in the last week of working on CC in 2016), we missed a case where clients was using their associated case manager's first and last names.

As a result, if you look at first and last name for the user/case manager for each client, they are undefined on the clients view:

Example screen capture with client names out of frame: image

tdooner commented 7 years ago

I did a bit of research into this. It looks like the BaseModel._getMultiResponse method restricts the resulting object's fields to only the columns specified in the Client model's constructor.

Also, Clients.findByOrg's SQL query doesn't SELECT the appropriate column names (user_first, user_last) the same way that the other Clients finder methods do. But even if it did, the _getMultiResponse call would strip them out.

So, I need to think a bit on what to do about this. A couple thoughts come to mind: