aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
71 stars 42 forks source link

Index table filters trigger the first form in the page when hitting 'return' in the search box #1306

Closed prioux closed 1 year ago

prioux commented 1 year ago

A POST to a controller is performed when it shouldn't happen.

To reproduce:

1) Go the an index page such as /tasks 2) Click on the small magnifying glass for one of the columns (e.g. the Task Type column) 3) Enter dummy text in the search box for the column (e.g. 'blah') 4) Hit return

In the case of the /tasks page, a request is posted to TasksController#update_multiple using the first hijacker submit button in the 'Update Attributes' button/menu.

See screenshots:

Screen Shot 2023-02-27 at 13 56 12

Screen Shot 2023-02-27 at 13 57 17

prioux commented 1 year ago

Solution: completely disable submit on Enter/Return in these little search boxes, the return key is not supposed to do anything.

prioux commented 1 year ago

The Rails server logfile show the request that was sent:

Processing by TasksController#update_multiple as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "cbrain_task"=>{"group_id"=>"", "results_data_provider_id"=>"27", "tool_config_id"=>""}, "commit"=>"Update", "dup_bourreau_id"=>"21", "archive
_dp_id"=>"", "per_page"=>"25", "update_group_id"=>"1"}
MontrealSergiy commented 1 year ago

temporary withdrow

prioux commented 1 year ago

Fixed by #1307