From 3468bac511a367dd2b456f0cc8fc0d6a1e92528a Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Fri, 10 Nov 2023 13:44:32 -0500 Subject: [PATCH 1/4] restore changes --- .../10117-guestbook-question-size-limit-raised.md | 1 + src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java | 4 ++-- src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java | 2 +- .../V6.0.0.4__10017-failure-with-long-custom-question.sql | 1 + src/main/webapp/resources/iqbs/messages.xhtml | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 doc/release-notes/10117-guestbook-question-size-limit-raised.md create mode 100644 src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql diff --git a/doc/release-notes/10117-guestbook-question-size-limit-raised.md b/doc/release-notes/10117-guestbook-question-size-limit-raised.md new file mode 100644 index 00000000000..ab5e84d78fe --- /dev/null +++ b/doc/release-notes/10117-guestbook-question-size-limit-raised.md @@ -0,0 +1 @@ +Custom questions in Guestbooks can now be more than 255 characters and the bug causing a silent failure when questions were longer than this limit has been fixed. \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java b/src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java index 2cb6f27c3e4..d880da5b4a8 100644 --- a/src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java +++ b/src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java @@ -2,7 +2,7 @@ import java.io.Serializable; import java.util.List; import jakarta.persistence.*; -import org.hibernate.validator.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; /** * @@ -41,7 +41,7 @@ public void setId(Long id) { private String questionType; @NotBlank(message = "{custom.questiontext}") - @Column( nullable = false ) + @Column( nullable = false, columnDefinition = "TEXT") private String questionString; private boolean required; diff --git a/src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java b/src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java index 9fb584a9133..8b09291d052 100644 --- a/src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java @@ -320,7 +320,7 @@ public String save() { logger.info("Guestbook Page Command Exception. Dataverse: " + dataverse.getName()); logger.info(ex.toString()); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, BundleUtil.getStringFromBundle("guestbook.save.fail"), " - " + ex.toString())); - //logger.severe(ex.getMessage()); + return null; } editMode = null; String msg = (create)? BundleUtil.getStringFromBundle("guestbook.create"): BundleUtil.getStringFromBundle("guestbook.save"); diff --git a/src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql b/src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql new file mode 100644 index 00000000000..9a3002378b3 --- /dev/null +++ b/src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql @@ -0,0 +1 @@ +ALTER TABLE customquestion ALTER COLUMN questionstring TYPE text; diff --git a/src/main/webapp/resources/iqbs/messages.xhtml b/src/main/webapp/resources/iqbs/messages.xhtml index bd17cf34d21..f8e1f5e8e9d 100644 --- a/src/main/webapp/resources/iqbs/messages.xhtml +++ b/src/main/webapp/resources/iqbs/messages.xhtml @@ -63,7 +63,7 @@ Server: - #{systemConfig.dataverseServer} + #{systemConfig.dataverseSiteUrl} #{msg.rendered()} From 9c3ac152ee3eaa3af7834ac6c17ac9bbee3570c2 Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Tue, 12 Mar 2024 17:43:41 -0400 Subject: [PATCH 2/4] update flyway version --- ....sql => V6.1.0.6__10017-failure-with-long-custom-question.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/{V6.0.0.4__10017-failure-with-long-custom-question.sql => V6.1.0.6__10017-failure-with-long-custom-question.sql} (100%) diff --git a/src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql b/src/main/resources/db/migration/V6.1.0.6__10017-failure-with-long-custom-question.sql similarity index 100% rename from src/main/resources/db/migration/V6.0.0.4__10017-failure-with-long-custom-question.sql rename to src/main/resources/db/migration/V6.1.0.6__10017-failure-with-long-custom-question.sql From c9b685aa942c156670aaa78355bf57b45accd20d Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Wed, 13 Nov 2024 11:40:22 -0500 Subject: [PATCH 3/4] Update flyway script --- ..._10017-failure-with-long-custom-question.sql => V6.4.0.2.sql} | 1 + 1 file changed, 1 insertion(+) rename src/main/resources/db/migration/{V6.1.0.6__10017-failure-with-long-custom-question.sql => V6.4.0.2.sql} (90%) diff --git a/src/main/resources/db/migration/V6.1.0.6__10017-failure-with-long-custom-question.sql b/src/main/resources/db/migration/V6.4.0.2.sql similarity index 90% rename from src/main/resources/db/migration/V6.1.0.6__10017-failure-with-long-custom-question.sql rename to src/main/resources/db/migration/V6.4.0.2.sql index 9a3002378b3..414e98975db 100644 --- a/src/main/resources/db/migration/V6.1.0.6__10017-failure-with-long-custom-question.sql +++ b/src/main/resources/db/migration/V6.4.0.2.sql @@ -1 +1,2 @@ +#10118 ALTER TABLE customquestion ALTER COLUMN questionstring TYPE text; From a663ad443e44ae2b01c8fde66f4234763e73c3c1 Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Wed, 13 Nov 2024 15:29:08 -0500 Subject: [PATCH 4/4] fix comment --- src/main/resources/db/migration/V6.4.0.2.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/V6.4.0.2.sql b/src/main/resources/db/migration/V6.4.0.2.sql index 414e98975db..bc4a85b278f 100644 --- a/src/main/resources/db/migration/V6.4.0.2.sql +++ b/src/main/resources/db/migration/V6.4.0.2.sql @@ -1,2 +1,2 @@ -#10118 +-- #10118 ALTER TABLE customquestion ALTER COLUMN questionstring TYPE text;