Bug #4995

Editing location with "all users" checked fails on edit page in postgres

Added by Ivan Necas over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Joseph Magen
Category:Web Interface
Target version:Sprint 22
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

Description

1. create a location
2. edit the location, check "all users" checkbox and save
3. edit again

Expected: no issues

Got:

PGError: ERROR: missing FROM-clause entry for table "usergroups" LINE 1: ... ((users.admin = 'f' OR users.admin IS NULL) AND (usergroups... ^ : SELECT id FROM "users" WHERE ((users.admin = 'f' OR users.admin IS NULL) AND (usergroups.admin = 'f' OR usergroups.admin IS NULL))

ActiveRecord::StatementInvalid
PGError: ERROR: missing FROM-clause entry for table "usergroups" LINE 1: ... ((users.admin = 'f' OR users.admin IS NULL) AND (usergroups... ^ : SELECT id FROM "users" WHERE ((users.admin = 'f' OR users.admin IS NULL) AND (usergroups.admin = 'f' OR usergroups.admin IS NULL))
app/models/taxonomy.rb:113:in `block (2 levels) in '
app/helpers/layout_helper.rb:92:in `block in multiple_selects'
app/helpers/layout_helper.rb:157:in `block (3 levels) in field'
app/helpers/layout_helper.rb:156:in `block (2 levels) in field'
app/helpers/layout_helper.rb:149:in `block in field'
app/helpers/layout_helper.rb:148:in `field'
app/helpers/layout_helper.rb:85:in `multiple_selects'
app/views/taxonomies/_form.html.erb:55:in `block in _app_views_taxonomies__form_html_erb__643643980205726403_70229832444720'
app/helpers/layout_helper.rb:248:in `form_for'
app/views/taxonomies/_form.html.erb:3:in `_app_views_taxonomies__form_html_erb__643643980205726403_70229832444720'
app/views/taxonomies/edit.html.erb:4:in `_app_views_taxonomies_edit_html_erb___2691520242893355174_75423320'
app/controllers/concerns/foreman/controller/taxonomies_controller.rb:67:in `block in edit'
app/models/taxonomy.rb:40:in `block in no_taxonomy_scope'
app/models/taxonomy.rb:47:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:143:in `as_location'
app/models/taxonomy.rb:46:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:108:in `as_org'
app/models/taxonomy.rb:45:in `as_taxonomy'
app/models/taxonomy.rb:39:in `no_taxonomy_scope'
app/controllers/concerns/foreman/controller/taxonomies_controller.rb:65:in `edit'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Associated revisions

Revision 144d6f9f
Added by Joseph Magen over 3 years ago

fixes #4995 - editing location with 'all users' checked fails on edit page in postgres

History

#1 Updated by Joseph Magen over 3 years ago

  • Assigned To set to Joseph Magen
  • Category set to Web Interface
  • Status changed from New to Ready For Testing

#2 Updated by Dominic Cleal over 3 years ago

  • Target version set to Sprint 22

#3 Updated by Dominic Cleal over 3 years ago

  • Release set to 9

#4 Updated by Joseph Magen over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 3 years ago

  • Release changed from 9 to 1.5.0

Also available in: Atom PDF