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,15 +292,17 @@ and set a flag in the request to indicate "back button confusion"
|
||||||
|
|
||||||
DataPropertyStatement dps = new DataPropertyStatementImpl();
|
DataPropertyStatement dps = new DataPropertyStatementImpl();
|
||||||
Literal submitted = submission.getLiteralsFromForm().get(copy.getVarNameForObject());
|
Literal submitted = submission.getLiteralsFromForm().get(copy.getVarNameForObject());
|
||||||
dps.setIndividualURI( copy.getSubjectUri() );
|
if( submitted != null ){
|
||||||
dps.setDatapropURI( copy.getPredicateUri() );
|
dps.setIndividualURI( copy.getSubjectUri() );
|
||||||
dps.setDatatypeURI( submitted.getDatatypeURI());
|
dps.setDatapropURI( copy.getPredicateUri() );
|
||||||
dps.setLanguage( submitted.getLanguage() );
|
dps.setDatatypeURI( submitted.getDatatypeURI());
|
||||||
dps.setData( submitted.getLexicalForm() );
|
dps.setLanguage( submitted.getLanguage() );
|
||||||
|
dps.setData( submitted.getLexicalForm() );
|
||||||
|
|
||||||
copy.prepareForDataPropUpdate(writeModel, dps);
|
copy.prepareForDataPropUpdate(writeModel, dps);
|
||||||
copy.setDatapropKey( Integer.toString(RdfLiteralHash.makeRdfLiteralHash(dps)) );
|
copy.setDatapropKey( Integer.toString(RdfLiteralHash.makeRdfLiteralHash(dps)) );
|
||||||
EditConfiguration.putConfigInSession(copy,session);
|
EditConfiguration.putConfigInSession(copy,session);
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<jsp:forward page="postEditCleanUp.jsp"/>
|
<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()
|
String onlyField = editConfig.getFields().keySet().iterator()
|
||||||
.next();
|
.next();
|
||||||
Literal value = submission.getLiteralsFromForm().get(onlyField);
|
Literal value = submission.getLiteralsFromForm().get(onlyField);
|
||||||
if ("".equals(value.getLexicalForm())) {
|
if( value == null ){
|
||||||
log.debug("Submission was a single field with an empty string");
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue