From 391bc3253d37ba6f48fcc4690e7e7177db9e6453 Mon Sep 17 00:00:00 2001 From: meek0 Date: Wed, 5 Feb 2020 16:54:18 -0500 Subject: [PATCH] fix 3.7.2 upgrade script --- .../main/java/org/obiba/mica/core/upgrade/Mica372Upgrade.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mica-core/src/main/java/org/obiba/mica/core/upgrade/Mica372Upgrade.java b/mica-core/src/main/java/org/obiba/mica/core/upgrade/Mica372Upgrade.java index adc42ced9e..9aa5f79b10 100644 --- a/mica-core/src/main/java/org/obiba/mica/core/upgrade/Mica372Upgrade.java +++ b/mica-core/src/main/java/org/obiba/mica/core/upgrade/Mica372Upgrade.java @@ -79,12 +79,12 @@ public void execute(Version version) { logger.info("Updating studies and networks with their membership sort orders."); mongoTemplate.execute(db -> db.eval(setMemberShipSortOrder())); - studyService.findAllStates().stream().filter(state -> !state.hasRevisionsAhead()).forEach(state -> { + studyService.findAllStates().stream().filter(state -> !state.hasRevisionsAhead() && state.isPublished()).forEach(state -> { studyService.save(studyService.findStudy(state.getId()), "Updating membership sort orders."); studyService.publish(state.getId(), true, PublishCascadingScope.NONE); }); - networkService.findAllStates().stream().filter(state -> !state.hasRevisionsAhead()).forEach(state -> { + networkService.findAllStates().stream().filter(state -> !state.hasRevisionsAhead() && state.isPublished()).forEach(state -> { networkService.save(networkService.findById(state.getId()), "Updating membership sort orders."); networkService.publish(state.getId(), true, PublishCascadingScope.NONE); });