Project

General

Profile

Bug #11473

Not able to set domain in interfaces initially

Added by Ryan Dyer about 3 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

I am seeing a behavior with 1.9.0 that I believe is a bug.
Setup:
Two puppet environments defined. (dev and factory)
Single domain defined. (domain.com)
Multiple subnets defined all belonging to the domain above.

Create a new host, select one of the puppet environments. Go to Interfaces and select edit. Attempt to set the Domain. There is no drop down. Cancel the edit interfaces dialog screen. Re-Edit and the drop down for the domain will work just fine. Also if you do not select a puppet environment initially, you can go to the edit dialog and select a domain. The issue seems to be related to selecting a puppet environment and then attempting to edit the interface. A quick cancel and re-edit resolves the issue.

I have tried this under chrome and IE with the same results


Related issues

Related to Foreman - Feature #10641: Ability to search VmWare networksClosed2015-05-28

Associated revisions

Revision 501853b5 (diff)
Added by Dominic Cleal about 3 years ago

fixes #11473 - remove re-init of domain select2 on env selection

After an environment was selected, the reloadOnAjaxComplete function
re-initialised every select2, but other dropdowns triggered
onContentLoad which excluded those with the without_select class.

Change reloadOnAjaxComplete to be consistent and also explicitly
re-init the subnet dropdown when the domain dropdown causes it to
change.

Also destroy select2 fields before storing the interface in the
"hidden" storage, allowing it to be re-initialised when the modal
is displayed again.

Revision aaf7d7a0 (diff)
Added by Dominic Cleal about 3 years ago

fixes #11473 - remove re-init of domain select2 on env selection

After an environment was selected, the reloadOnAjaxComplete function
re-initialised every select2, but other dropdowns triggered
onContentLoad which excluded those with the without_select class.

Change reloadOnAjaxComplete to be consistent and also explicitly
re-init the subnet dropdown when the domain dropdown causes it to
change.

Also destroy select2 fields before storing the interface in the
"hidden" storage, allowing it to be re-initialised when the modal
is displayed again.

(cherry picked from commit 501853b511d52f078c1d0933afec955b25356e54)

History

#1 Updated by Dominic Cleal about 3 years ago

#2 Updated by Dominic Cleal about 3 years ago

  • Legacy Backlogs Release (now unused) set to 72

#3 Updated by Marek Hulán about 3 years ago

I reproduced the issue, it seems related to select2, web console prints following

Uncaught TypeError: Cannot read property 'hasClass' of null

when I click on domain select box. It fails after selection of any environment even if domain is already set, you go back to first tab, select an environment and get back to interfaces form. It seems that only environment selection breaks the select2 js, if you change deploy on or other field that also redraw the form, domain selection works again.

#4 Updated by Dominic Cleal about 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#5 Updated by The Foreman Bot about 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2682 added
  • Pull request deleted ()

#6 Updated by Dominic Cleal about 3 years ago

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

Also available in: Atom PDF