From 7941b435d552d43158803b2d0a76261875a66680 Mon Sep 17 00:00:00 2001 From: Zachary Howarth Date: Wed, 1 Dec 2010 16:27:11 -0400 Subject: [PATCH] Don't render PID field unless a pid is present, as it displays the default collection object. --- plugins/pidfield/pidfield.module | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/pidfield/pidfield.module b/plugins/pidfield/pidfield.module index 902d6690..53e176a2 100644 --- a/plugins/pidfield/pidfield.module +++ b/plugins/pidfield/pidfield.module @@ -276,11 +276,14 @@ function theme_pidfield_formatter_default($element) { //return $element['#item']['safe']; $pid = $element['#item']['safe']; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item = new Fedora_Item($pid); + if(!empty($pid)) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($pid); - return fedora_repository_get_items($pid); - //return $item->objectProfile->objLabel; + return fedora_repository_get_items($pid); + //return $item->objectProfile->objLabel; + } + return null; } /**