Details
-
Type:
Bug
-
Status: Verified
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.7, 11.4, 12.0, 19.0
-
Component/s: Web Services
-
Labels:None
-
12 status:Resolved
-
Test Plan:
Description
Steps to reproduce
- ensure
SAK-33428has been applied to the code - run SakaiScript.jws?wsdl and
- call addNewToolToAllWorkspaces() with a high page position like 99 (to ensure the new tool gets added to the end of the list)
After the script finishes not all of the sites' new tool will be added to the correct position
In Sakai 10.7 SakaiScript.jws (this code includes the patch in SAK-33428)
public String addNewToolToAllWorkspaces(String sessionid, String toolid, String pagetitle, String tooltitle, int pagelayout, int position, boolean popup) throws AxisFault { . . . for (Iterator<String> j = siteIdSet.iterator(); j.hasNext();) { . . . int numPages = siteEdit.getPages().size(); if(position >= numPages) { position = numPages-1; } int pagePosition = sitePageEdit.getPosition(); if (pagePosition != position) { // set the page position LOG.debug("Page:" + sitePageEdit + " position=" + sitePageEdit.getPosition() + " position_new=" + position); sitePageEdit.setPosition(position); siteEdit.setCustomPageOrdered(true); siteService.save(siteEdit); LOG.debug("Page moved"); }
The variable position overwrites itself and is inside a for loop, so as sites are processed if the numPages happens to be smaller, it will change the position for all subsequent sites to that position and will keep reducing if you happen to have sites with less and less numPages.