[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wido den Hollander closed CLOUDSTACK-974.
-----------------------------------------


This has indeed been resolved with the Query API refactor.

Sorting is now done properly.
                
> listServiceOfferings doesn't sort by sortKey for non-root users
> ---------------------------------------------------------------
>
>                 Key: CLOUDSTACK-974
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-974
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: API
>    Affects Versions: 4.0.0, 4.0.1
>            Reporter: Wido den Hollander
>            Assignee: Prachi Damle
>            Priority: Minor
>             Fix For: 4.2.0
>
>
> I was just notified by a colleague that there is different behaviour between 
> the Admin UI and User UI.
> When you list all Service Offerings in the Admin interface they get sorted by 
> sortKey descending.
> If you go and create an Instance as a user through the wizard the Service 
> Offerings aren't sorted, they are in the order like they are in the database.
> I logged the MySQL queries and they are:
> ** ADMIN **
> SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, 
> disk_offering.name, disk_offering.display_text, disk_offering.disk_size, 
> disk_offering.tags, disk_offering.type, disk_offering.removed, 
> disk_offering.created, disk_offering.recreatable, 
> disk_offering.use_local_storage, disk_offering.system_use, 
> disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, 
> service_offering.cpu, service_offering.speed, service_offering.ram_size, 
> service_offering.nw_rate, service_offering.mc_rate, 
> service_offering.ha_enabled, service_offering.limit_cpu_use, 
> service_offering.host_tag, service_offering.default_use, 
> service_offering.vm_type, service_offering.sort_key
> FROM service_offering INNER JOIN disk_offering ON 
> service_offering.id=disk_offering.id
> WHERE disk_offering.type='Service'
> AND disk_offering.system_use = 0
> AND disk_offering.system_use = 0
> AND disk_offering.removed IS NULL
> ORDER BY service_offering.sort_key DESC
> ** USER **
> SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, 
> disk_offering.name, disk_offering.display_text, disk_offering.disk_size, 
> disk_offering.tags, disk_offering.type, disk_offering.removed, 
> disk_offering.created, disk_offering.recreatable, 
> disk_offering.use_local_storage, disk_offering.system_use, 
> disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, 
> service_offering.cpu, service_offering.speed, service_offering.ram_size, 
> service_offering.nw_rate, service_offering.mc_rate, 
> service_offering.ha_enabled, service_offering.limit_cpu_use, 
> service_offering.host_tag, service_offering.default_use, 
> service_offering.vm_type, service_offering.sort_key
> FROM service_offering INNER JOIN disk_offering ON 
> service_offering.id=disk_offering.id
> WHERE disk_offering.type='Service'
> AND disk_offering.domain_id IS NULL
> AND disk_offering.system_use = 0
> AND disk_offering.removed IS NULL
> To me it seems this goes wrong in 
> ManagementServerImpl.searchForServiceOfferings:
> Filter searchFilter = new Filter(ServiceOfferingVO.class, "sortKey", 
> isAscending, cmd.getStartIndex(), cmd.getPageSizeVal());
> getStartIndex and getPageSizeVal are both NULL since the user UI doesn't add 
> page nor pagesize to the API request.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to