Skip to content
Snippets Groups Projects
Commit faff088f authored by srosse's avatar srosse
Browse files

OO-1322: fix an issue if several different types is found for the uploaded...

OO-1322: fix an issue if several different types is found for the uploaded resources and the import is restricted to a type of resources
parent dac0fb53
No related branches found
No related tags found
No related merge requests found
......@@ -410,9 +410,7 @@ public class OLATApiAdapter extends LogDelegator implements ch.ethz.pfplms.scorm
success = item.archiveScoData();
}
} catch (Exception e) {
if(isLogDebugEnabled()) {
logWarn("Error at OLATApiAdapter.archiveScoData(): " + e.getMessage(), e);
}
logError("Error at OLATApiAdapter.archiveScoData(): ", e);
}
return success;
}
......
......@@ -21,6 +21,7 @@ package org.olat.repository.ui.author;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.olat.NewControllerFactory;
......@@ -183,18 +184,22 @@ public class ImportRepositoryEntryController extends FormBasicController {
boolean allOk = true;
if(limitTypes != null && handlers != null) {
for(ResourceHandler handler:handlers) {
for(Iterator<ResourceHandler> handlerIt=handlers.iterator(); handlerIt.hasNext(); ) {
boolean match = false;
ResourceHandler handler = handlerIt.next();
for(String limitType:limitTypes) {
if(limitType.equals(handler.getHandler().getSupportedType())) {
match = true;
}
}
if(!match) {
allOk = false;
uploadFileEl.setErrorKey("add.failed", new String[] {});
handlerIt.remove();
}
}
if(handlers.isEmpty()) {
allOk = false;
uploadFileEl.setErrorKey("add.failed", new String[] {});
}
}
return allOk;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment