From 1543e048d03b1372d7d179dd0855e20d4faf5305 Mon Sep 17 00:00:00 2001 From: Julia Damerow Date: Tue, 10 Aug 2021 15:06:29 -0600 Subject: [PATCH] Bug/vspc 177 (#238) * [VSPC-177] fixed registration issue; attempt to fix space not found fixed issue when no exhibition mode has been set yet * [VSPC-177] removed commented out code * [VSPC-177] fixed test cases * [VSPC-177] catch exception if incomplete spacelinks exist in the data * [VSPC-177] ignore if no source space exists --- .../edu/asu/diging/vspace/core/model/impl/SpaceLink.java | 1 + .../diging/vspace/core/services/impl/SpaceManager.java | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/vspace/src/main/java/edu/asu/diging/vspace/core/model/impl/SpaceLink.java b/vspace/src/main/java/edu/asu/diging/vspace/core/model/impl/SpaceLink.java index 497b8c508..e6294ab9b 100644 --- a/vspace/src/main/java/edu/asu/diging/vspace/core/model/impl/SpaceLink.java +++ b/vspace/src/main/java/edu/asu/diging/vspace/core/model/impl/SpaceLink.java @@ -29,6 +29,7 @@ public class SpaceLink extends VSpaceElement implements ISpaceLink { @JsonIgnore @ManyToOne(targetEntity=Space.class) @JoinColumn(name = "source_space_id") + @NotFound(action=NotFoundAction.IGNORE) private ISpace sourceSpace; @ManyToOne(targetEntity=Space.class) diff --git a/vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/SpaceManager.java b/vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/SpaceManager.java index 9a2ee549b..12ad85664 100644 --- a/vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/SpaceManager.java +++ b/vspace/src/main/java/edu/asu/diging/vspace/core/services/impl/SpaceManager.java @@ -287,14 +287,7 @@ public Iterable addIncomingLinkInfoToSpaces(Iterable spaces) { Iterator iterator = spaces.iterator(); while (iterator.hasNext()) { Space space = iterator.next(); - try { - space.setIncomingLinks((spaceLinkRepo.findByTargetSpace(space)).size() > 0 ? true : false); - } catch (EntityNotFoundException ex) { - // if the data is incomplete this might happen (e.g. spaces used in links - // don't exist anymore. - space.setIncomingLinks(false); - logger.error("Could not load space links.", ex); - } + space.setIncomingLinks((spaceLinkRepo.findByTargetSpace(space)).size() > 0 ? true : false); } return spaces; }