Skip to content

Commit

Permalink
Merge pull request #10118 from QualitativeDataRepository/IQSS/10117-c…
Browse files Browse the repository at this point in the history
…ustomquestion_limit_and_failure

IQSS/10117-increase-guestbook-question-length
  • Loading branch information
ofahimIQSS authored Nov 19, 2024
2 parents 42d00d1 + 1d300f4 commit b812173
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
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

0 comments on commit b812173

Please sign in to comment.