Fix SQL error getting cached terms for programme review.
Merge branch 'staging'