-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Won't Fix
-
Affects Version/s: 5.1.3
-
Component/s: None
-
Tags:
Currently, when a file is uploaded, the FileManageActionsBean:
- calls createDocumentFromBlob() with the flag overwrite always true
- it doesn't always check the returned value (in the case of null returned there are cases in which should appear a NPE)
- it doesn't properly check all the cases of failures. For instance, if the overwrite wouldn't be required, the case of couldn't update the document because already exists falls in the situation "wrong_document_type"
Moreover, the logic in default implementation (defaultCreate() in FileManagerService) is somehow wrong: there are only 2 branches
if (overwrite && docModel != null) {
}else{
}
so the case: "do not overwrite and the document existing" is falling in the second case, and a "new" document is created.
This fix could be dangerous, having impacts in other plugins, because until now they were never been called with flag overwrite on false.