Skip to content

Commit

Permalink
Bug/vspc 177 (#238)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
jdamerow authored Aug 10, 2021
1 parent 8abdf63 commit 1543e04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,7 @@ public Iterable<Space> addIncomingLinkInfoToSpaces(Iterable<Space> spaces) {
Iterator<Space> 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;
}
Expand Down

0 comments on commit 1543e04

Please sign in to comment.