Bug 518027

Summary: While creating new channel - base channels show up multiple times in drop down lists
Product: Red Hat Satellite 5 Reporter: wes hayutin <whayutin>
Component: WebUIAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: medium Docs Contact:
Priority: urgent    
Version: 530CC: cperry, gkhachik, liko, mzazrivec, psklenar, tao, xdmoon
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://dhcp77-153.rhndev.redhat.com/rhn/channels/manage/Edit.do
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-22 14:03:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 518256    
Attachments:
Description Flags
duplicate channels none

Description wes hayutin 2009-08-18 14:21:30 UTC
Created attachment 357802 [details]
duplicate channels

Description of problem:

duplicate channel listings in parent channel combo box

See screenshot:

recreate:
channels -> manage software channels -> create new channel
select the parent channel drop down box

see duplicates of channels

Spoke to zues, he had a fix and wanted a bug on 530. So here it is :)

Comment 1 Milan Zázrivec 2009-10-05 10:58:42 UTC
*** Bug 519696 has been marked as a duplicate of this bug. ***

Comment 2 Milan Zázrivec 2009-10-05 10:59:12 UTC
*** Bug 527202 has been marked as a duplicate of this bug. ***

Comment 3 Petr Sklenar 2009-10-14 13:08:38 UTC
*** Bug 528923 has been marked as a duplicate of this bug. ***

Comment 5 Xixi 2010-03-05 23:55:18 UTC
Looks like this is a regression introduced in perl->java port (/network/software/channels/manage/edit.pxt -> /rhn/channels/manage/Edit.do).

spacewalk-java-0.5.44/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml
...
    <sql-query name="Channel.findAllBaseChannels">
        <![CDATA[SELECT {c.*}
                 FROM rhnChannel {c},
                      rhnUserChannel uc,
                      rhnChannelCloned c_1_
                 WHERE c.id = uc.channel_id
                   AND c.id = c_1_.id (+)
                   AND uc.org_id = :org_id
                   AND uc.role = 'subscribe'
                   AND c.parent_channel is null]]>
        <return alias="c" class="com.redhat.rhn.domain.channel.Channel" />
    </sql-query>
...

This returns duplicate entries if there're multiple channels cloned from the same source channel - i.e., mappings in rhnChannelCloned with the same source channel ID.  It needs to filter for unique channels.

Resetting Assignee/QA to default for component.

Comment 6 Xixi 2010-03-05 23:58:25 UTC
(In reply to comment #0)
> recreate:
You'll need to clone at least one base channel first in order to see the bug manifesting.

> channels -> manage software channels -> create new channel
> select the parent channel drop down box
> 
> see duplicates of channels
>

Comment 7 Justin Sherrill 2010-05-10 19:39:51 UTC
Should be fixed here:

30178fd40213afb5c2932443926960fc6f6746dd

Comment 10 Petr Sklenar 2010-06-02 11:07:06 UTC
test procedure:
OLD:
1. have a more channel, more cloned channel
2. channels -> manage software channels -> create new channel
# channels were shown multiple times with the same name, as in attachment.jpg

NEW:
cobbler-1.6.6-8.el5sat.x86_64
spacewalk-java-0.5.44-77.el5sat.noarch
spacewalk-base-0.5.23-35.el5sat.noarch

channels -> manage software channels -> create new channel
one channel in one line, no duplicates

Comment 12 errata-xmlrpc 2010-06-22 14:03:16 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0498.html