Bug 198090

Summary: ACI editor table sort problem
Product: [Retired] 389 Reporter: Mark Tolmacs <mark.tolmacs>
Component: UI - ConfigurationAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 1.0CC: benl, jgalipea, jstrunk, nkinder, yzhang
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-29 22:58:48 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: 152373, 249650, 493682    
Attachments:
Description Flags
diffs
none
cvs commit log
none
UI to prove aci editing is correct now none

Description Mark Tolmacs 2006-07-09 12:14:49 UTC
Description of problem:
When trying to edit targets in the ACI editor pane -> Targets tab and sorting
the target attribute table by Name, cannot check the checkbox at first and whats
more, the name field changes to an attribute name which is IMHO the attribute in
that exact position on the unsorted list. So when I try to check the attribute
in the sorted list, I select the wrong attribute, because the sorting seems to
be just visually done.

How reproducible:
Always

Steps to Reproduce:
1. Go to Directory Console
2. Select Directory Server Console
3. Select Directory Tab
4. Select an entry
5. Hit Ctrl + L
6. Select any ACI or create new
7. On the "Edit ACI for..." pane select Targets tab
8. Sort table by name
9. Try to check some attribute, and the discrepancy should show himself.
  
Actual results:
Selecting an unwanted attribute for ACI target inclusion.

Expected results:
Selecting the visually shown attribute for ACI target inclusion.

Additional info:
Running on Sun Java 1.5.0.16

Comment 1 Jeff Strunk 2006-10-20 16:25:52 UTC
I also encountered this problem with Fedora DS 1.0.2 .

You can work around it by following these steps for each attribute you want to
select or deselect.
1. Click the column name you want to sort on.
2. Find and click ONCE in the check box of the attribute you want to modify.
3. Repeat until you are finished.

To check that no other attributes were changed, you can clcik the checkbox icon
in  the column names to sort by selection.

Comment 3 Rich Megginson 2008-12-16 19:14:46 UTC
Created attachment 327150 [details]
diffs

Comment 4 Rich Megginson 2008-12-16 22:17:02 UTC
Created attachment 327179 [details]
cvs commit log

Reviewed by: nkinder (Thanks!)
Fix Description: The main problem was that the Table Model code was not checking the type of the model change event, and was just unconditionally resetting/initializing the internal indexes array every time the checkbox was checked.  This caused the table to revert back to the original order every time a checkbox was checked on or off.  The only events which should cause the indexes to be reset/initialized are the INSERT and DELETE types, not the UPDATE type.  There were also some problems with setting up the initial model, and I cleaned up some bogus code.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no

Comment 5 Jenny Severance 2009-02-27 19:31:59 UTC
Checking and unchecking target attributes after a sort by name, seems to behave properly however, I am not certain of what the "discrepancy" in the description was.  I'de like to verify that exactly what was happening is no longer happening.
Thanks

Comment 6 Yi Zhang 2009-04-06 22:48:21 UTC
I have same question as Jenny does. My guess is that the unchecked column will become checked after sorting. And I can verify this mis-behave is not happening. 

I will verify with Nathan.

Comment 7 Yi Zhang 2009-04-06 23:07:38 UTC
just check with Nathan, my guess is close but not exact.

When we click the table title to request a "sort" action, not just the column of check boxes should be shift correspondingly, but the backend data (called model) need to change as well. 

my test result above is part ot verification, but i need one more test

test is below:

1. setup 2 acis for a certain user. make sure use console and make the target column sorted back and force couple times
such as: FTPDownloadBandwith ARecord
2. save the above change
3. make ldapsearch against this user. verify the aci includes correct selected aci

test result: pass 
 [root@mv32a-vm ~]# /usr/lib/mozldap/ldapsearch -D "CN=directory manager" -w redhat123 -s sub -b "ou=accounting,dc=example,dc=com" "uid=*Bt*" "aci"
version: 1
dn: uid=BTahamont34, ou=Accounting, dc=example,dc=com
aci: (targetattr != "FTPDownloadBandwidth || ARecord") (version 3.0;acl "newac
 i";allow (all)(userdn = "ldap:///anyone");)
 [root@mv32a-vm ~]# 

======================================================
check attached screen as well

Comment 8 Yi Zhang 2009-04-06 23:09:14 UTC
Created attachment 338413 [details]
UI to prove aci editing is correct now

Comment 9 Yi Zhang 2009-04-06 23:09:48 UTC
bug closed now

Comment 10 Chandrasekar Kannan 2009-04-29 22:58:48 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/RHEA-2009-0455.html