diff --git a/doc/release-notes/12556-can-not-set-guestbook-with-id-over-127.md b/doc/release-notes/12556-can-not-set-guestbook-with-id-over-127.md new file mode 100644 index 00000000000..694fc234cac --- /dev/null +++ b/doc/release-notes/12556-can-not-set-guestbook-with-id-over-127.md @@ -0,0 +1,3 @@ +## Bug ## +Fixed bug when calling PUT api/datasets/{datsetId}/guestbook body = {id over 127}. Values for Guestbook IDs over 127 are no longer failing. + diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetGuestbookCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetGuestbookCommand.java index 097c5312035..5e837c39174 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetGuestbookCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetGuestbookCommand.java @@ -32,7 +32,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException { // Make sure the requested guestbook is available via the dataset's ancestry final List guestbooks = dataset.getOwner().getAvailableGuestbooks(); for (Guestbook gb : guestbooks) { - if (gb.getId() == guestbook.getId()) { + if (gb.getId().equals(guestbook.getId())) { allowedGuestbook = gb; break; }