Project

General

Profile

Bug #5609

undefined method `id' for nil:NilClass on host form when location not visible

Added by Dominic Cleal over 6 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

When a location isn't visible to a user, the host edit form can throw the following backtrace:

NoMethodError
undefined method `id' for nil:NilClass
app/views/hosts/_form.html.erb:42:in `block (2 levels) in app_views_hosts_form_html_erb___4293687029106106936_69881101386960'
app/helpers/layout_helper.rb:218:in `form_for'
app/views/hosts/_form.html.erb:7:in `block in app_views_hosts_form_html_erb___4293687029106106936_69881101386960'
app/models/taxonomy.rb:56:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:143:in `as_location'
app/models/taxonomy.rb:55:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:108:in `as_org'
app/models/taxonomy.rb:54:in `as_taxonomy'
app/views/hosts/_form.html.erb:5:in `_app_views_hosts__form_html_erb___4293687029106106936_69881101386960'
app/views/hosts/new.html.erb:7:in `_app_views_hosts_new_html_erb__692129816314295724_69881101356420'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

https://github.com/theforeman/foreman/pull/1336

Associated revisions

Revision ce815b85 (diff)
Added by Julien Pivotto over 6 years ago

fixes #5609 - backport bugfix in hosts form when location is nil

This commit fixes a bug that has been fixed in
acfbc45886c4d81a2a3ca5af433a6124a0a7191a

History

#1 Updated by Dominic Cleal over 6 years ago

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

Merged to 1.4-stable as ce815b8573a63299f7b2f052aec39594c603cbe9 (already on develop).

Also available in: Atom PDF