From 06a97d36b1f3b65bae0846101535ff158d120e32 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 25 Jan 2011 23:05:22 +0000 Subject: [PATCH] NIHVIVO-1871 Fix addPublicationToPerson form so at least we don't get to a broken form in repair mode. Redirecting to authorship page, which is a low-cost though not ideal solution. --- .../edit/forms/addPublicationToPerson.jsp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/productMods/edit/forms/addPublicationToPerson.jsp b/productMods/edit/forms/addPublicationToPerson.jsp index 2c3b0489..701bd385 100644 --- a/productMods/edit/forms/addPublicationToPerson.jsp +++ b/productMods/edit/forms/addPublicationToPerson.jsp @@ -63,7 +63,7 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers Individual subject = (Individual) request.getAttribute("subject"); Individual obj = (Individual) request.getAttribute("object"); - //check to see if this is an edit of existing, if yes redirect to pub + // Check to see if this is an edit of existing, if yes redirect to pub if( obj != null ){ List stmts = obj.getObjectPropertyStatements( nodeToPubProp ); if( stmts != null && stmts.size() > 0 ){ @@ -78,6 +78,20 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers } } } + + /* This form is not prepared to deal with editing an existing relationship, so redirect + * to authorship page if no publication was found. This is not ideal, because you can't add + * a linked information resource from that page, but you can at least continue to the back end. + * May want to modify form in a future version to support repair mode. + */ + if (obj != null) { + String objectUri = obj.getURI(); + %> + + + + <% + } %>