Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IQSS/10117-increase-guestbook-question-length #10118

Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
*
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,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");
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/db/migration/V6.4.0.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- #10118
ALTER TABLE customquestion ALTER COLUMN questionstring TYPE text;
2 changes: 1 addition & 1 deletion src/main/webapp/resources/iqbs/messages.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" type="date" />
</h:outputText>
<strong>Server: </strong>
#{systemConfig.dataverseServer}
#{systemConfig.dataverseSiteUrl}
</ui:fragment>
</div>
#{msg.rendered()}
Expand Down
Loading