lagotto / alm-report

ALM Reports
http://almreports.plos.org/
MIT License
8 stars 3 forks source link

'Select all articles' is not working #58

Closed jenniferlin15 closed 10 years ago

jenniferlin15 commented 10 years ago

I clicked on the Alzheimer's Association report tile on home page. 26 articles were returned in the search. I clicked on Select All. A message appears that tells me 25 articles were added and that I can select the remaining 1. I click to select the remaining articles. The page takes a few seconds to load and the article is not added. (Screen shot shows the page with the single remaining article which has not been selected.) When I click on Select All at this point, nothing happens & nothing is processed (page does not reload).

add articles alm reports

jure commented 10 years ago

Interesting. Will take a look, thanks for the report.

jure commented 10 years ago

Found it:

2014-10-07 21:48:54.104 [FATAL] NoMethodError - undefined method `[]' for #<SearchResult:0x00000003c18880>:
  app/controllers/home_controller.rb:92:in `block in select_all_search_results'
  app/controllers/home_controller.rb:91:in `select_all_search_results'
  actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.19) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.19) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.19) lib/abstract_controller/callbacks.rb:18:in `block in process_action'

I haven't written a test for the "select all" functionality and haven't refactored it yet. Fixing this soon.

jenniferlin15 commented 10 years ago

This issue also appears in the staging environment for ALM 2.1 reports. It does not affect the current PLOS production environment for ALM Reports (almreports.plos.org).