From 3742fd302246319a2aebe33c12acc93e60b6ddb6 Mon Sep 17 00:00:00 2001 From: qqmyers Date: Fri, 27 Sep 2024 13:52:31 -0400 Subject: [PATCH] move updateDatasetUser past the file updates it apparently causes new datafiles, which don't have create dates to start to be persisted, cause a failure with an sql insert to the dataset table with a null createdate. Moving it back to this location assures the datafiles have create dates and avoids the exception. It's not clear to me why trying to get the authenticatedUser in the updateDatasetUser() call causes this. --- .../engine/command/impl/UpdateDatasetVersionCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java index fc4eb4e6002..cddb4f308a3 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java @@ -129,8 +129,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException { } //Get or create (currently only when called with fmVarMet != null) a new edit version DatasetVersion editVersion = theDataset.getOrCreateEditVersion(fmVarMet); - //Update the DatasetUser (which merges it into the context) - updateDatasetUser(ctxt); + //Will throw an IllegalCommandException if a system metadatablock is changed and the appropriate key is not supplied. checkSystemMetadataKeyIfNeeded(editVersion,persistedVersion); @@ -261,7 +260,8 @@ public Dataset execute(CommandContext ctxt) throws CommandException { theDataset.setModificationTime(getTimestamp()); - + //Update the DatasetUser (which merges it into the context) + updateDatasetUser(ctxt); if (clone != null) { AuthenticatedUser au = (AuthenticatedUser) getUser();