From 2c47f9bfb2db53a716e67654409bc03a814e4c87 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 17 Apr 2012 13:45:04 -0400 Subject: [PATCH] Allow returns from modifications... --- api/fedora_item.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index d107a844..66259275 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -268,7 +268,7 @@ RDF; $description->appendChild($newrel); - $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); + return $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); //print ($description->dump_node()); /* $params = array( 'pid' => $this->pid, @@ -958,6 +958,8 @@ RDF; * Error suppression? Refer to soap_call for usage (just passed along here). */ function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API', $quiet=FALSE) { + $toReturn = NULL; + //Determine if it's inline xml; if it is, modify by value if ($this->get_datastream($dsid)->controlGroup === 'X') { $content = ''; @@ -968,7 +970,7 @@ RDF; $content = $filename_or_content; } - $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); } //Otherwise, write to web-accessible temp file and modify by reference. else { @@ -989,12 +991,14 @@ RDF; $file_url = file_create_url($file); - $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); if ($created_temp && is_file($file) && is_writable($file)) { file_delete($file); } } + + return $toReturn; } /**