From e363b937b46db67891b8143402f19fdf246fd55a Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 16 Oct 2012 13:35:42 -0300 Subject: [PATCH] Fix acquiring of ownerId Associated with ISLANDORA-757: The findObjects call was broken. --- api/fedora_item.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 4a26e516..82e8bbfa 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -79,7 +79,7 @@ class Fedora_Item { if (!empty($raw_objprofile)) { $this->objectProfile = $raw_objprofile->objectProfile; $this->datastreams = $this->get_datastreams_list_as_array(); - $this->ownerId = & Fedora_Item::getOwnerId($pid); + $this->ownerId = Fedora_Item::getOwnerId($pid); } else { $this->objectProfile = ''; @@ -1165,7 +1165,6 @@ RDF; * @return type */ function modify_object($label = '', $state = NULL, $ownerId = NULL, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { - $params = array( 'pid' => $this->pid, // Default to the current owner if none is provided.. @@ -1551,9 +1550,17 @@ RDF; * The Fedora PID to retrieve the */ static function getOwnerId($PID) { - $params = array( - 'query' => array(array('property' => 'pid', 'operator' => 'eq', 'value' => $object_id)), + 'query' => array( + 'conditions' => array( + array( + 'property' => 'pid', + 'operator' => 'eq', + 'value' => $PID, + ), + ), + 'terms' => '', + ), 'resultFields' => array('pid', 'ownerId'), 'maxResults' => 1, ); @@ -1562,7 +1569,8 @@ RDF; if (!$response) { return FALSE; } - return $response->result->resultList->objectFields->ownerId; + $ownerId = $response->result->resultList->objectFields->ownerId; + return $ownerId; } }