mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALF-20023 Recent Sites and Favourite Sites in copy/move pickers empty
So the bug was caused by 2 problems: one in ScriptPreferenceService and one in person.sites.get.js The first problem was that ScriptPreferenceService constructs raw Mozilla NativeObjects - a very unusual practice in itself - and it does not provide a default value as required by ECMA 9.1 from the ECMA standard. I've added this code to the NativeObject (can't change the type to ScriptableHashMap<K, V> or similar as the API is published). I've also fixed the same bug (unreported, possibly never apparent) in a jbpm class. The second problem was that person.sites.get.js simply could never return preferences data if the caller provided a filter (favourites or recents) and did not also provide a page size. There was a logic error in the algorithm such that the size defaulted to 0 thus providing a 'page' of zero results as a default. I assume this is a merge error from cloud, but I don't know. I added tests for the JavaScript API's favourites/recents filter calls and logging here and there. Also deleted some dead code. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55474 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -69,7 +69,7 @@ public class PreferenceServiceImplTest
|
||||
// JUnit rule to initialise the default Alfresco spring configuration
|
||||
@ClassRule public static ApplicationContextInit APP_CONTEXT_INIT = new ApplicationContextInit();
|
||||
|
||||
private static final String USERNAME2 = "userBad";
|
||||
private static final String USERNAME2 = "username2";
|
||||
|
||||
// Rules to create test users. Note that this class is unusual in that we do *NOT* want to reuse users across test methods.
|
||||
public AlfrescoPerson testUser1 = new AlfrescoPerson(APP_CONTEXT_INIT);
|
||||
@@ -219,7 +219,8 @@ public class PreferenceServiceImplTest
|
||||
{
|
||||
// This test is running as user1 and the JavaScript needs to know that.
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
model.put("username", testUser1.getUsername());
|
||||
model.put("username1", testUser1.getUsername());
|
||||
model.put("username2", testUser2.getUsername());
|
||||
|
||||
ScriptLocation location = new ClasspathScriptLocation("org/alfresco/repo/preference/script/test_preferenceService.js");
|
||||
SCRIPT_SERVICE.executeScript(location, model);
|
||||
|
Reference in New Issue
Block a user