Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 812031 - Satellite 5.4: Wrong sort directions in some drop-down-lists in webUI
Summary: Satellite 5.4: Wrong sort directions in some drop-down-lists in webUI
Alias: None
Product: Spacewalk
Classification: Community
Component: WebUI
Version: 1.8
Hardware: All
OS: All
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
Depends On: 705154
Blocks: space18
TreeView+ depends on / blocked
Reported: 2012-04-12 15:09 UTC by Stephen Herr
Modified: 2018-12-04 14:35 UTC (History)
4 users (show)

Fixed In Version: spacewalk-web-1.8.9-1
Doc Type: Bug Fix
Doc Text:
Clone Of: 705154
Last Closed: 2012-11-01 16:17:49 UTC

Attachments (Terms of Use)

Description Stephen Herr 2012-04-12 15:09:35 UTC
+++ This bug was initially created as a clone of Bug #705154 +++

Created attachment 499215 [details]

Description of problem:

 The sort direction in some drop-down-lists are displayed nor correctly. First of all it is very confusing in the dialogs of managing channels.

 Look the screenshots attached on this Bugzilla for  clarification. 

Version-Release number of selected component (if applicable):
Red Hat Network Satellite 5.4

How reproducible:
100% on a Satellite 5.4 with a lot of channels imported 

Actual results:

 The drop-down items are not sorted hierarchical, by following Parent then Child Channels

Expected results:

  The drop-down items are be sorted hierarchical, by following Parent then Child Channels

--- Additional comment from mmello@redhat.com on 2011-05-16 15:57:49 EDT ---


Looking the screenshots attached, we can verify: 

Clone_Channel_from.jpg - Wrong/Buggy
Channel_compare_packages.jpg - Wrong/Buggy
Channel_add_packages_from_channel.jpg - Correct

If you look at the Java source, you will see that while pulling the data from the DB it sorts the channel based on the Channel name for Parent and Child Channels, as expected:

  URL: https://satellite.example.com/rhn/channels/manage/ChannelPackagesAdd.do?manage_channel_navi_node=add_channel_packages&cid=570


<action path="/channels/manage/ChannelPackagesAdd"
        <forward name="default" path="/WEB-INF/pages/channel/manage/addpackages.jsp" />
          <forward name="confirm" path="/channels/manage/ChannelPackagesAddConfirm.do" redirect="true" />

private List<SelectableChannel> findChannels(User user, Long selectedChan) {
        //Add Red Hat Base Channels, and custom base channels
        List<SelectableChannel> chanList = new ArrayList<SelectableChannel>();
        for (Channel chanTmp : ChannelFactory.listRedHatBaseChannels()) {
            if (canAccessChannel(user, chanTmp)) {
                chanList.add(setSelected(chanTmp, selectedChan));
                for (Channel chanChild : chanTmp.getAccessibleChildrenFor(user)) {
                    chanList.add(setSelected(chanChild, selectedChan));
        for (Channel chanTmp : ChannelFactory.listCustomBaseChannels(user)) {
            if (canAccessChannel(user, chanTmp)) {
                chanList.add(setSelected(chanTmp, selectedChan));
                for (Channel chanChild : chanTmp.getAccessibleChildrenFor(user)) {
                    chanList.add(setSelected(chanChild, selectedChan));
        return chanList;

     * Get a list of channels with no org that are not a child
     * @return List of Channels
    public static List<Channel> listRedHatBaseChannels() {
        Map params = new HashMap();
        return singleton.listObjectsByNamedQuery("Channel.findRedHatBaseChannels", params);

<query name="Channel.findRedHatBaseChannels">
                from com.redhat.rhn.domain.channel.Channel as c where c.org is null
                                                and parentChannel is null order by c.name]]>

 However, the other two pages (Perl) throws the following query to get the channel lists:

Clone_Channel_from.jpg - Wrong/Buggy
Channel_compare_packages.jpg - Wrong/Buggy


$query = <<EOQ;
SELECT  ACh.channel_name as NAME, ACh.channel_id as ID, ACh.channel_depth as DEPTH, C.org_id as CHANNEL_ORG_ID
  FROM  rhnAvailableChannels ACh inner join 
        rhnChannel C on C.id = ACh.channel_id  left outer join
        rhnAvailableChannels ACh2 on C.parent_channel = ACh2.channel_id
  where ACh.org_id = :org_id AND (C.parent_channel is NULL or ACH2.org_id = :org_id)

  $sth = $dbh->prepare($query);
  $sth->execute_h(org_id => $org_id);

  So, given the information above, we believe that there's a bug in the Perl code.

Marcelo Moreira de Mello

--- Additional comment from sherr@redhat.com on 2012-04-12 11:07:14 EDT ---

Put in simpler language, the issue here is that we have several drop-down boxes for selecting channels throughout the webui, and they arrange the channels differently on java pages and on perl pages.

Java pages tend to have a hierarchical view of the visible channels, something like this: 

Base Channel 1
  Child Channel 1
  Child Channel 2
  Child Channel 3
Base Channel 2
Base Channel 3
  Child Channel 4
Base Channel 4
Base Channel 5
  Child Channel 5

whereas perl pages tend to organize the channels into flat lists by organization, like so:

My Channels
  Channel 1
  Channel 2
  Channel 3
  Channel 4
  Channel 5
Red Hat Chanenls
  Channel 6
  Channel 7
  Channel 8

Perl pages when they do try to also sort hierarchical tend to get it wrong. This bug is asking that we standardize one one way of listing the channels, preferably the java (newer) way.

Comment 1 Stephen Herr 2012-04-12 15:20:07 UTC
Committed to Spacewalk master: 893bc22592af1a354037335f9bc2559f09d1056a

Comment 2 Jan Pazdziora 2012-10-30 19:22:49 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 3 Jan Pazdziora 2012-11-01 16:17:49 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

Note You need to log in before you can comment on or make changes to this bug.