Allow for select-collection optimization to be disabled

Since there could be a potential edge case where the optimization falters
We'll provide a simple fallback to revert to using the original query
This commit is contained in:
Peter Dietz
2014-10-28 01:50:42 -04:00
parent 8ad0eca0b1
commit 7e893ffb38
3 changed files with 11 additions and 1 deletions

View File

@@ -1506,6 +1506,11 @@ public class Collection extends DSpaceObject
public static Collection[] findAuthorizedOptimized(Context context, int actionID) throws java.sql.SQLException
{
if(! ConfigurationManager.getBooleanProperty("org.dspace.content.Collection.findAuthorizedPerformanceOptimize", true)) {
// Fallback to legacy query if config says so. The rationale could be that a site found a bug.
return findAuthorized(context, null, actionID);
}
List<Collection> myResults = new ArrayList<Collection>();
if(AuthorizeManager.isAdmin(context))