Project

General

Profile

Actions

Bug #5609

closed

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

Added by Dominic Cleal almost 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
Difficulty:
Triaged:
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

Actions #1

Updated by Dominic Cleal almost 10 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).

Actions

Also available in: Atom PDF