Project

General

Profile

Bug #14252

Creating a new organization redirects to list rather than host assignment and edit properties

Added by Brad Buckingham almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1317846
Description of problem:
In 6.1 when we create new organization we have process described in UI (1)Create Organization-> 2)Select Hosts -> 3)Edit Properties), so we have access to bunch of organization properties in time of entity creation procedure, not editing
In 6.2 when we input name for new organization and push 'submit' button we get entity created right away without possibility to change something for its properties.

If that is intended behavior then we still have a defect as mentioned process (1)Create Organization-> 2)Select Hosts -> 3)Edit Properties) is still visible in UI like workflow is changed, but some parts was forgotten to be removed

Version-Release number of selected component (if applicable):
6.2 SNAP 3.1

How reproducible:
Always

Steps to Reproduce:
1. Try to create new organization in UI

Actual results:
Entity created and no access to change any organization property

Expected results:
User has access to organization properties in time of creation procedure
Or
UI should be changed, so he/she didn't expect that such operation can be performed

Additional info:


Related issues

Related to Foreman - Bug #14369: When creating new organization, host selection step won't show, if the user is n context of different organization.Closed2016-03-29

Associated revisions

Revision 12dd1387 (diff)
Added by Shimon Shtein almost 5 years ago

Fixes #14252 - Redirecting to edit taxonomy page if no hosts to assign

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Subject changed from Cannot work with properties when create new organization to Creating a new organization redirects to list rather than host assignment and edit properties
  • Category set to Organizations and Locations

This might just when a current org/loc is selected, count_nil_hosts is incorrectly calculated as the number of hosts without an org/loc because it isn't unscoped. Working in any context ought to avoid the bug. Can't confirm without corresponding debug, preferably SQL logs though.

The wizard ought to still skip step 2 (host assignment) and move to edit if no hosts are available, rather than redirecting to the index.

#2 Updated by Shimon Shtein almost 5 years ago

  • Assignee set to Shimon Shtein

As far as I can see count_nil_hosts calculates its value by invoking Host.where(taxonomy_id => nil).count
which is unscoped, unless we set a default scope on host...

Right now the system will move to the second step only if there are hosts that are not assigned to any organization.

Anyway I will add a bypass to move to the third step from the first one, when count_nil_hosts == 0.

#3 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3368 added

#4 Updated by Shimon Shtein almost 5 years ago

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

#5 Updated by Dominic Cleal almost 5 years ago

Shimon Shtein wrote:

As far as I can see count_nil_hosts calculates its value by invoking Host.where(taxonomy_id => nil).count
which is unscoped, unless we set a default scope on host...

There's a default scope on hosts and all other taxonomy-constrained objects, so it's not unscoped.

#6 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 136

#7 Updated by Shimon Shtein almost 5 years ago

  • Related to Bug #14369: When creating new organization, host selection step won't show, if the user is n context of different organization. added

Also available in: Atom PDF