From 39dcd91485ec1007e6d6ab200b422b3da700a0f6 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 6 Mar 2013 18:52:22 +0100 Subject: [PATCH] islandora_delete_object() now follows function description. islandora_delete_object() no longer throws. Now it will only return TRUE if successful, FALSE otherwise as expected. This fixes the issue where solution packs were not reinstalling existing objects. --- islandora.module | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/islandora.module b/islandora.module index d5287286..fa0bff24 100644 --- a/islandora.module +++ b/islandora.module @@ -836,10 +836,18 @@ function islandora_add_object(NewFedoraObject &$object) { * An object to delete. * * @return bool - * The ingested FedoraObject, after running the pre/post ingest hooks. + * TRUE if successful, FALSE otherwise. */ function islandora_delete_object(FedoraObject &$object) { - return $object->repository->purgeObject($object->id); + try { + $object->repository->purgeObject($object->id); + $object = NULL; + return TRUE; + } + catch(Exception $e) { + // Exception message gets logged in Tuque Wrapper. + return FALSE; + } } /**