Merge pull request #1123 from tuub/DS-2833

DS-2833: UploadWithEmbargoStep didn't parse Bitstream UUID correctly
This commit is contained in:
Pascal-Nicolas Becker
2015-10-29 15:52:03 +01:00
2 changed files with 6 additions and 2 deletions

View File

@@ -256,6 +256,10 @@ public class Util {
} }
catch (Exception e) catch (Exception e)
{ {
// at least log this error to make debugging easier
// do not silently return null only.
log.warn("Unable to recoginze UUID from String \""
+ val.trim() + "\". Will return null.", e);
// Problem with parameter // Problem with parameter
return null; return null;
} }

View File

@@ -513,8 +513,8 @@ public class UploadWithEmbargoStep extends UploadStep
} }
// FORM: UploadStep SELECTED OPERATION: go to EditBitstreamPolicies // FORM: UploadStep SELECTED OPERATION: go to EditBitstreamPolicies
else if (buttonPressed.startsWith("submit_editPolicy_")){ else if (buttonPressed.startsWith("submit_editPolicy_")){
String bitstreamID = buttonPressed.substring("submit_editPolicy_".length()); UUID bitstreamID = UUID.fromString(buttonPressed.substring("submit_editPolicy_".length()));
Bitstream b = bitstreamService.find(context, Util.getUUIDParameter(request, bitstreamID)); Bitstream b = bitstreamService.find(context, bitstreamID);
subInfo.setBitstream(b); subInfo.setBitstream(b);
return STATUS_EDIT_POLICIES; return STATUS_EDIT_POLICIES;
} }