Fix retrieval of file from record
Fix calculation of cached values
Account for missing values when rendering graphs
Fix retrieval of file when approving record
Fix cached values and field retrieval under certain conditions

- Correct update of cached values on layout update
- Retrieve correct values when displayed fields different to search
Sort graphs by title
Remove confusing use of "discrete"
Many updates and fixes to graph rendering