Open nicolasfranck opened 2 years ago
In lay terms: if the page of organisational templates in the org admin is long enough, and you can type in a search query in the search bar, then the page crashes.
Reproduce:
I haven't investigated much but changing search
method in file app/models/templates.rb
as follow (so removing the joins'(org)
clause) seems to return a better result:
# Retrieves unarchived templates whose title or org.name includes the term
# passed
scope :search, lambda { |term|
#unarchived.joins(:org)
unarchived.where('lower(templates.title) LIKE lower(:term) OR ' \
'lower(orgs.name) LIKE lower(:term)',
term: "%#{term}%")
}
See https://github.com/DMPRoadmap/roadmap/issues/3156