Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing next on a paginated search result causes a 500 error #52

Open
sukima opened this issue Dec 20, 2012 · 2 comments
Open

Pressing next on a paginated search result causes a 500 error #52

sukima opened this issue Dec 20, 2012 · 2 comments
Labels

Comments

@sukima
Copy link
Owner

sukima commented Dec 20, 2012

When you search and the results returned are more then the paginated count next / previous are used to load each page. However when you do so the server crashes with a 500 error.

I am speculating this is related to the fact that when the equipment_assests controller does a search it returns the completed dataset and not a paginated one. So when the client requests any page past the first one there is no data available. However, it could very well just be a typo.

@moskvin
Copy link

moskvin commented Nov 27, 2017

I have similar issue with Redmine 3.4.3 + the plugin + search

Started GET "/projects/xxxxxx-xxxxx/search?utf8=%E2%9C%93&scope=&q=hello+world" for 94.130.107.186 at 2017-11-27 07:52:36 +0000
Processing by SearchController#index as HTML
  Parameters: {"utf8"=>"✓", "scope"=>"", "q"=>"hello world", "id"=>"xxxxxx-xxxxx"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 5163ms (ActiveRecord: 5126.2ms)

ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR:  column equipment_assets.project_id does not exist
LINE 1: ..."."id" FROM "equipment_assets" WHERE (1 = 1) AND (equipment_...
                                                             ^
: SELECT DISTINCT "equipment_assets"."created_on", "equipment_assets"."id" FROM "equipment_assets" WHERE (1 = 1) AND (equipment_assets.project_id IN (52)) AND (((name ILIKE '%hello%') OR (serial_number ILIKE '%hello%') OR (comment ILIKE '%hello%')) AND ((name ILIKE '%world%') OR (serial_number ILIKE '%world%') OR (comment ILIKE '%world%')))  ORDER BY "equipment_assets"."created_on" DESC, "equipment_assets"."id" DESC):
  lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:171:in `fetch_ranks_and_ids'
  lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:91:in `search_result_ranks_and_ids'
  lib/redmine/search.rb:127:in `block in load_result_ids'
  lib/redmine/search.rb:125:in `each'
  lib/redmine/search.rb:125:in `load_result_ids'
  lib/redmine/search.rb:115:in `block in load_result_ids_from_cache'
  lib/redmine/search.rb:114:in `load_result_ids_from_cache'
  lib/redmine/search.rb:99:in `result_ids'
  lib/redmine/search.rb:70:in `result_count'
  app/controllers/search_controller.rb:75:in `index'
  plugins/redmine_equipment_status_viewer/lib/redmine_equipment_status_viewer/patches/search_controller_patch.rb:49:in `index_with_quick_jump_equipment'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Why we need project_id, if the plugin should work without project relation?

@sukima
Copy link
Owner Author

sukima commented Nov 28, 2017

I have no idea, I have not looked at this code in over five years. I would not even know where to begin. I'm more than willing to transfer ownership/stewardship to someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants