Skip to content

Commit b812173

Browse files
authored
Merge pull request #10118 from QualitativeDataRepository/IQSS/10117-customquestion_limit_and_failure
IQSS/10117-increase-guestbook-question-length
2 parents 42d00d1 + 1d300f4 commit b812173

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

src/main/java/edu/harvard/iq/dataverse/CustomQuestion.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import java.io.Serializable;
33
import java.util.List;
44
import jakarta.persistence.*;
5-
import org.hibernate.validator.constraints.NotBlank;
5+
import jakarta.validation.constraints.NotBlank;
66

77
/**
88
*
@@ -41,7 +41,7 @@ public void setId(Long id) {
4141
private String questionType;
4242

4343
@NotBlank(message = "{custom.questiontext}")
44-
@Column( nullable = false )
44+
@Column( nullable = false, columnDefinition = "TEXT")
4545
private String questionString;
4646
private boolean required;
4747

src/main/java/edu/harvard/iq/dataverse/GuestbookPage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public String save() {
322322
logger.info("Guestbook Page Command Exception. Dataverse: " + dataverse.getName());
323323
logger.info(ex.toString());
324324
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, BundleUtil.getStringFromBundle("guestbook.save.fail"), " - " + ex.toString()));
325-
//logger.severe(ex.getMessage());
325+
return null;
326326
}
327327
editMode = null;
328328
String msg = (create)? BundleUtil.getStringFromBundle("guestbook.create"): BundleUtil.getStringFromBundle("guestbook.save");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- #10118
2+
ALTER TABLE customquestion ALTER COLUMN questionstring TYPE text;

src/main/webapp/resources/iqbs/messages.xhtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" type="date" />
6464
</h:outputText>
6565
<strong>Server: </strong>
66-
#{systemConfig.dataverseServer}
66+
#{systemConfig.dataverseSiteUrl}
6767
</ui:fragment>
6868
</div>
6969
#{msg.rendered()}

0 commit comments

Comments
 (0)