merge to trunk. Fixing exceptions on submission of null value in dataproperty form. NIHVIVO-1021
This commit is contained in:
parent
cc0aab3814
commit
2968a09613
1 changed files with 15 additions and 10 deletions
|
@ -292,6 +292,7 @@ and set a flag in the request to indicate "back button confusion"
|
|||
|
||||
DataPropertyStatement dps = new DataPropertyStatementImpl();
|
||||
Literal submitted = submission.getLiteralsFromForm().get(copy.getVarNameForObject());
|
||||
if( submitted != null ){
|
||||
dps.setIndividualURI( copy.getSubjectUri() );
|
||||
dps.setDatapropURI( copy.getPredicateUri() );
|
||||
dps.setDatatypeURI( submitted.getDatatypeURI());
|
||||
|
@ -301,6 +302,7 @@ and set a flag in the request to indicate "back button confusion"
|
|||
copy.prepareForDataPropUpdate(writeModel, dps);
|
||||
copy.setDatapropKey( Integer.toString(RdfLiteralHash.makeRdfLiteralHash(dps)) );
|
||||
EditConfiguration.putConfigInSession(copy,session);
|
||||
}
|
||||
%>
|
||||
|
||||
<jsp:forward page="postEditCleanUp.jsp"/>
|
||||
|
@ -404,8 +406,11 @@ and set a flag in the request to indicate "back button confusion"
|
|||
String onlyField = editConfig.getFields().keySet().iterator()
|
||||
.next();
|
||||
Literal value = submission.getLiteralsFromForm().get(onlyField);
|
||||
if ("".equals(value.getLexicalForm())) {
|
||||
log.debug("Submission was a single field with an empty string");
|
||||
if( value == null ){
|
||||
log.debug("No parameters found in submission for field \"" + onlyField +"\"");
|
||||
return true;
|
||||
}else if( "".equals(value.getLexicalForm())) {
|
||||
log.debug("Submission was a single field named \"" + onlyField + "\" with an empty string");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue