Project

General

Profile

Bug #25228

[object Object] instead of organization name on Content -> Sync status page

Added by Mirosław Zalewski 11 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web UI
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

On Content -> Sync status page (/katello/sync_management) there is [object Object] instead of organization name. See attached screenshot.

Katello git commit id: 77a4d76db2d1524f152281a78ef8d17f4fdfa646
Foreman git commit id: 9ccfbde5c417ed466b21c997d01d4608cc4e8c57

On website, following message is displayed:

user: vagrant  USE eager loading detected    Katello::Product => [:provider] Add to your finder: :includes => [:provider]
user: vagrant  USE eager loading detected    Katello::Repository => [:root]  Add to your finder: :includes => [:root]
user: vagrant  USE eager loading detected    Katello::Product => [:root_repositories]  Add to your finder: :includes => [:root_repositories]
user: vagrant  USE eager loading detected    Katello::Product => [:repositories]  Add to your finder: :includes => [:repositories]

In firefox dev tools console, I see:

checkPropTypes.js:19
Warning: Failed prop type: Invalid prop `currentOrganization` of type `object` supplied to `Layout`, expected `string`.
    in Layout (created by Connect(Layout))
    in Connect(Layout)
    in Provider
checkPropTypes.js:19
Warning: Failed prop type: Invalid prop `currentOrganization` of type `object` supplied to `TaxonomySwitcher`, expected `string`.
    in TaxonomySwitcher (created by Layout)
    in Layout (created by Connect(Layout))
    in Connect(Layout)
    in Provider
checkPropTypes.js:19
Warning: Failed prop type: Invalid prop `currentTaxonomy` of type `object` supplied to `TaxonomyDropdown`, expected `string`.
    in TaxonomyDropdown (created by TaxonomySwitcher)
    in TaxonomySwitcher (created by Layout)
    in BaseVerticalNavMasthead (created by VerticalNav.Masthead)
    in VerticalNav.Masthead (created by Layout)
    in nav (created by BaseVerticalNav)
    in Unknown (created by withContext(Component))
    in withContext(Component) (created by BaseVerticalNav)
    in BaseVerticalNav (created by ControlledComponent)
    in ControlledComponent (created by VerticalNav)
    in VerticalNav (created by Layout)
    in Layout (created by Connect(Layout))
    in Connect(Layout)
    in Provider

screenshot.png View screenshot.png 170 KB Mirosław Zalewski, 10/18/2018 11:58 AM
Screenshot

Related issues

Has duplicate Katello - Bug #25632: organization changed from Default org to [object Object] on sync status page in satellite WebUI.Duplicate

Associated revisions

Revision 013fd5f3 (diff)
Added by John Mitsch 9 months ago

Fixes #25228 - Sync status page sets org correctly

  • Fixes #25228 - Sync status page not working

Foreman expects a string with the name of the
current organization for 'current_organization'.
More details on this can be found in the issue.

The reason we haven't seen this earlier is because
we are not using Katello::ApplicationController for
most Katello pages. We instead use ::ApplicationController
which is correctly setting the 'current_organization'.

It looks like sync status is the only active page that uses
the Katello controller, so we saw the issue there.

This changes the 'current_organization' method to be
'current_organization_data' and the 'current_organization'
method now returns a string with the organization name.

There may be more thorough fixes (the code in the controller
is quite old), but seeing as sync status is the only
active page that uses it, this seems like an appropiate fix.

Of course I am always open to suggestions for improvement :)

History

#1 Updated by John Mitsch 11 months ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.10.0
  • Assignee set to Walden Raines

#2 Updated by Christine Fouant 10 months ago

  • Target version changed from Katello 3.10.0 to Katello 3.11.0

#3 Updated by Walden Raines 10 months ago

  • Has duplicate Bug #25632: organization changed from Default org to [object Object] on sync status page in satellite WebUI. added

#4 Updated by Walden Raines 10 months ago

  • Assignee changed from Walden Raines to John Mitsch

Thanks for agreeing to take this John.

I have tracked this down to the fact that current_organization is returning a string in foreman - https://github.com/theforeman/foreman/pull/5898/files#diff-d07b3cdd6c00768e06bfed349d3c808fR28

And an object in this old katello page - https://github.com/Katello/katello/blob/master/app/controllers/katello/application_controller.rb#L52-L73

As far as I can tell the sync management page is the only page that uses Katello::ApplicationController, the rest inherit from ::ApplicationController.

#5 Updated by John Mitsch 10 months ago

  • Bugzilla link set to 1651129

#6 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7874 added

#7 Updated by John Mitsch 9 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF