Red Hat Bugzilla – Bug 406251
3.15: Auto select version for a product on enter_bug.cgi if the version is marked current in the versions table
Last modified: 2013-06-24 00:17:41 EDT
Created patch that illustrates how we can do the sortkey instead of the current
column proposed before.
The versions will be order by sortkey and placed in data/versioncache as it is
now. enter_bug.cgi will continue to auto select the last in the list if no
default is given as before. I have added a redhat/update_versions_sortkey.pl
script that will update the sortkeys in the versions table based on the order of
values for each product in the script. We can edit it to out liking and then
update when needed.
There is also a fix included for Bugzilla/Ajax.pm. In it I was originally
sorting the versions there as well regardless of how they are listed in
data/versioncache. So I removed the sorting in getVersions() so that they
display in the UI properly. I still sort though if they are getting all of the
I also updated editversions.cgi to allow editing of the sortkey values through
When/if this is pushed to live, we will need to coordinate with Meethune/Matt on
how best to get the current version list from the live database so that it can
be sorted and applied later.
1. Get sysadmin to run the update_versions_sortkey.pl script on the live system
and catch the current version output to a text file which they will send to us.
2. Append the version data to the __DATA__ section of the
and then edit the data to put the versions into the proper chronological order.
3. Have sysadmin alter the versions table to add the new sortkey column.
4. Give the updated script to sysadmin to re-run on the live server which will
use the data in __DATA__ to update the sortkey values in versions.
5. Update the Bugzilla code package on live server to have the system start
using the new sorting mechanisms.
Created attachment 290241 [details]
Version sort key patch for rh_bugzilla_2_18
LOC Estimation for 3.0 port:
Adding 30% due to editversions.cgi being very different and will
need extra work for porting.
checksetup.pl or Schema.pm: 2
selenium test case to verify proper version selected by default: 2 hours
LOC Total: 1010 + (1010 * .30) = 1312
I think this is something we will not need to worry about. We do not currently
support this in 2.18 and upstream is now using Sort::Versions which does a
pretty good job of sorting and enter_bug.cgi will automatically choose the last
version in the list which should be the highest. We will reopen this if there is
substantial call for it but right now there are more important things to work on.