updates for fixing error when new content type is added when editing an existing page in page management (previously, data getter URI was checked for each content section/data getter URI, and this was resulting in an error when new content section/data getter was added in edit mode).

This commit is contained in:
hjkhjk54 2012-08-06 20:55:49 +00:00
parent e8840bdc23
commit 71cdc0ae52

View file

@ -250,12 +250,17 @@ public class ManagePagePreprocessor extends
//To get data getter uris, check if editing an existing set and include those as form inputs //To get data getter uris, check if editing an existing set and include those as form inputs
if(editConfiguration.isParamUpdate()) { if(editConfiguration.isParamUpdate()) {
//Although this is editing an existing page, new content might have been added which would not include
//existing data getter URIs, so important to check whether the key exists within the json object in the first place
if(jsonObject.containsKey("URI")) {
String URIValue = jsonObject.getString("URI"); String URIValue = jsonObject.getString("URI");
if(URIValue != null) { if(URIValue != null) {
log.debug("Existing URI for data getter found: " + URIValue);
String dataGetterURISubmissionName = pn.getDataGetterVarName(counter); String dataGetterURISubmissionName = pn.getDataGetterVarName(counter);
submission.addUriToForm(editConfiguration, dataGetterURISubmissionName, new String[]{URIValue}); submission.addUriToForm(editConfiguration, dataGetterURISubmissionName, new String[]{URIValue});
} }
} }
}
} }