You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our test environment I tried a single search that had no results. I then went to the admin dashboard, clicked the "Searches" tab and was presented with an internal server error, instead of the overview I had seen when there were no searches at all.
The logs show:
I, [2024-10-24T12:50:41.041167 #295] INFO -- : Started GET "/admin/searches" for <IP> at 2024-10-24 12:50:41 +0000
I, [2024-10-24T12:50:41.043500 #295] INFO -- : Processing by AdminController#searches as HTML
I, [2024-10-24T12:50:41.066908 #295] INFO -- : Completed 500 in 23ms (ActiveRecord: 4.2ms | Allocations: 7768)
F, [2024-10-24T12:50:41.069929 #295] FATAL -- :
NoMethodError (undefined method `round' for nil:NilClass):
app/controllers/admin_controller.rb:304:in `searches'
app/controllers/application_controller.rb:78:in `switch_locale'
app/controllers/application_controller.rb:33:in `check_deleted_articles'
According to https://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-average, the .average method returns nil when there are no rows. In my case, I hadn't searched for a project, so it breaks on line 304. I guess that if I had only searched for a project but not for or within a collection, it would break on line 305.
The text was updated successfully, but these errors were encountered:
In our test environment I tried a single search that had no results. I then went to the admin dashboard, clicked the "Searches" tab and was presented with an internal server error, instead of the overview I had seen when there were no searches at all.
The logs show:
fromthepage/app/controllers/admin_controller.rb
Lines 299 to 310 in 8408e08
According to https://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-average, the
.average
method returnsnil
when there are no rows. In my case, I hadn't searched for a project, so it breaks on line 304. I guess that if I had only searched for a project but not for or within a collection, it would break on line 305.The text was updated successfully, but these errors were encountered: