From ca95ad8d0b260060c7e7ed435767bd134cbf3907 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Tue, 3 Dec 2024 15:24:04 -0500 Subject: [PATCH] #11044 fix failing tests --- .../edu/harvard/iq/dataverse/DataverseFacetServiceBean.java | 4 ++-- .../engine/command/impl/AbstractWriteDataverseCommand.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DataverseFacetServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DataverseFacetServiceBean.java index 804f1fe2943..56f522fa816 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DataverseFacetServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DataverseFacetServiceBean.java @@ -56,9 +56,9 @@ public DataverseFacet create(int displayOrder, DatasetFieldType fieldType, Datav dataverseFacet.setDisplayOrder(displayOrder); dataverseFacet.setDatasetFieldType(fieldType); dataverseFacet.setDataverse(ownerDv); - - em.persist(dataverseFacet); ownerDv.getDataverseFacets().add(dataverseFacet); + em.persist(dataverseFacet); + cache.invalidate(ownerDv.getId()); return dataverseFacet; } diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/AbstractWriteDataverseCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/AbstractWriteDataverseCommand.java index 2a8bb18a942..91f3a5b823c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/AbstractWriteDataverseCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/AbstractWriteDataverseCommand.java @@ -93,7 +93,6 @@ private void processInputLevels(CommandContext ctxt) { dataverse.addInputLevelsMetadataBlocksIfNotPresent(inputLevels); } ctxt.fieldTypeInputLevels().deleteFacetsFor(dataverse); - dataverse.setDataverseFieldTypeInputLevels(new ArrayList<>()); inputLevels.forEach(inputLevel -> { inputLevel.setDataverse(dataverse); ctxt.fieldTypeInputLevels().create(inputLevel);