From 3578524da3cb34ba173eae585f2358881661b050 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Tue, 11 Oct 2005 15:26:42 +0000 Subject: [PATCH] Add some debugging log helpers --- lib/metadata/valueinstance.inc.php | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/lib/metadata/valueinstance.inc.php b/lib/metadata/valueinstance.inc.php index 49aaaa7..f2ddfab 100644 --- a/lib/metadata/valueinstance.inc.php +++ b/lib/metadata/valueinstance.inc.php @@ -93,6 +93,8 @@ class KTValueInstance extends KTEntity { function &getByLookupAndParentBehaviour($oLookup, $oBehaviour, $aOptions = null) { $iLookupId = KTUtil::getId($oLookup); $iBehaviourId = KTUtil::getId($oBehaviour); + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: lookup id is ' . print_r($iLookupId, true)); + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: behaviour id is ' . $iBehaviourId); $sInstanceTable = KTUtil::getTableName('field_value_instances'); $sBehaviourOptionsTable = KTUtil::getTableName('field_behaviour_options'); $aQuery = array( @@ -102,6 +104,11 @@ class KTValueInstance extends KTEntity { array($iBehaviourId, $iLookupId), ); $iId = DBUtil::getOneResultKey($aQuery, 'instance_id'); + if (PEAR::isError($iId)) { + $GLOBALS['default']->log->error('KTValueInstance::getByLookupAndParentBehaviour: error from db is: ' . print_r($iId, true)); + return $iId; + } + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: id of instance is ' . $iId); if (KTUtil::arrayGet($aOptions, 'ids')) { return $iId; } -- libgit2 0.21.4