sciencehistory / scihist_digicoll

Science History Institute Digital Collections
Other
13 stars 0 forks source link

[scihist_digicoll/production] NoMethodError: undefined method `order!' for class Work Did you mean? order #2783

Open honeybadger[bot] opened 2 days ago

honeybadger[bot] commented 2 days ago

@jrochkind reports: I did this one messing with admin Work screen, trying to search for "child works: yes".

More disturbing is that I did NOT get the custom error page we intend, I just got a blank white page with small type "Server Error". So our custom error pages may be broken?

Backtrace

line 706 of [PROJECT_ROOT]/app/controllers/admin/works_controller.rb: build_search
line 22 of [PROJECT_ROOT]/app/controllers/admin/works_controller.rb: index
line 28 of [PROJECT_ROOT]/app/controllers/application_controller.rb: block in batch_kithe_indexable

View full backtrace and more info at honeybadger.io

eddierubeiz commented 1 day ago

Our custom error pages are fine, but the admin works controller is using a reserved word as a parameter: format, which causes the errors controller to render the text template instead of errors/internal_error.html.erb.

See: https://stackoverflow.com/questions/70726614/ruby-on-rails-use-format-as-a-url-get-parameter

eddierubeiz commented 1 day ago

I'm going to rename that parameter from format to work_format and add a regression test.

jrochkind commented 1 day ago

Our custom error pages are fine, but the admin works controller is using a reserved word as a parameter: format,

I just ran into something similar with Oral History controllers when I tried to upgrade Rails to latest, except it was actually an error about calling format on an object that didn't have such a method; I just rolled back cause I wasn't planning on dealing with it now, but that's interesting.

Thanks for fixing it here! And nice job diagnosing!