upload small fix
This commit is contained in:
parent
abd4f0e5e2
commit
6068878cd4
|
@ -492,9 +492,12 @@ public class DescriptionServiceImpl implements DescriptionService {
|
|||
|
||||
if (FieldType.isTextType(fieldType)) {
|
||||
if (FieldType.UPLOAD.equals(fieldType) && !this.conventionService.isNullOrEmpty(persist.getTextValue())){
|
||||
StorageFile storageFile = this.storageFileService.copyToStorage(UUID.fromString(persist.getTextValue()), StorageType.Main, true, new BaseFieldSet().ensure(StorageFile._id));
|
||||
this.storageFileService.updatePurgeAt(storageFile.getId(), null);
|
||||
data.setTextValue(storageFile.getId().toString());
|
||||
UUID fileId = this.conventionService.isValidUUID(persist.getTextValue()) ? UUID.fromString(persist.getTextValue()) : null;
|
||||
if (fileId != null && !this.storageFileService.fileRefExists(fileId.toString(), StorageType.Main)){
|
||||
StorageFile storageFile = this.storageFileService.copyToStorage(fileId, StorageType.Main, true, new BaseFieldSet().ensure(StorageFile._id));
|
||||
this.storageFileService.updatePurgeAt(storageFile.getId(), null);
|
||||
}
|
||||
data.setTextValue(fileId == null ? null : fileId.toString());
|
||||
} else {
|
||||
data.setTextValue(persist.getTextValue());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue