From dac62b0c160bfeac74f7ca611f9a8a628a8352ca Mon Sep 17 00:00:00 2001 From: Ali HAMDI Date: Fri, 13 Oct 2023 12:42:44 +0100 Subject: [PATCH] fix: update nes configuration for image storage location - EXO-64344 (#171) --- .../jcr/upgrade/MoveNodesUpgradePlugin.java | 12 ++++++++---- data-upgrade-packaging/pom.xml | 4 ++++ pom.xml | 7 ++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/data-upgrade-move-folders/src/main/java/org/exoplatform/jcr/upgrade/MoveNodesUpgradePlugin.java b/data-upgrade-move-folders/src/main/java/org/exoplatform/jcr/upgrade/MoveNodesUpgradePlugin.java index 71d7768d9..088bb66df 100644 --- a/data-upgrade-move-folders/src/main/java/org/exoplatform/jcr/upgrade/MoveNodesUpgradePlugin.java +++ b/data-upgrade-move-folders/src/main/java/org/exoplatform/jcr/upgrade/MoveNodesUpgradePlugin.java @@ -111,10 +111,14 @@ public void processUpgrade(String oldVersion, String newVersion) { for (Space space : spaceArray) { String originFolderPath = "/Groups" + space.getGroupId() + originPath; String destinationFolderPath = "/Groups" + space.getGroupId() + destinationPath; - Item originFolderNode = session.getItem(originFolderPath); - if(originFolderNode != null) { - session.move(originFolderPath, destinationFolderPath); - movedFoldersCount ++; + try { + Item originFolderNode = session.getItem(originFolderPath); + if (originFolderNode != null) { + session.move(originFolderPath, destinationFolderPath); + movedFoldersCount++; + } + } catch(RepositoryException e) { + log.warn("Folder {} to move was not found, ignoring it", originFolderPath, e); } // remove unnecessary folders if defined in init params if(!foldersToRemove.isEmpty()) { diff --git a/data-upgrade-packaging/pom.xml b/data-upgrade-packaging/pom.xml index 73978cce7..fd47e02a0 100644 --- a/data-upgrade-packaging/pom.xml +++ b/data-upgrade-packaging/pom.xml @@ -80,6 +80,10 @@ ${project.groupId} data-upgrade-es-reindex + + ${project.groupId} + data-upgrade-move-folders + diff --git a/pom.xml b/pom.xml index c704392ad..739d93dc9 100644 --- a/pom.xml +++ b/pom.xml @@ -32,8 +32,8 @@ data-upgrade-notifications data-upgrade-processes-permissions data-upgrade-es-reindex - data-upgrade-packaging data-upgrade-move-folders + data-upgrade-packaging @@ -133,6 +133,11 @@ data-upgrade-es-reindex ${project.version} + + ${project.groupId} + data-upgrade-move-folders + ${project.version} + ${project.groupId} data-upgrade-packaging