Commit 3578524da3cb34ba173eae585f2358881661b050
1 parent
2a111463
Add some debugging log helpers
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3798 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
0 deletions
lib/metadata/valueinstance.inc.php
| @@ -93,6 +93,8 @@ class KTValueInstance extends KTEntity { | @@ -93,6 +93,8 @@ class KTValueInstance extends KTEntity { | ||
| 93 | function &getByLookupAndParentBehaviour($oLookup, $oBehaviour, $aOptions = null) { | 93 | function &getByLookupAndParentBehaviour($oLookup, $oBehaviour, $aOptions = null) { |
| 94 | $iLookupId = KTUtil::getId($oLookup); | 94 | $iLookupId = KTUtil::getId($oLookup); |
| 95 | $iBehaviourId = KTUtil::getId($oBehaviour); | 95 | $iBehaviourId = KTUtil::getId($oBehaviour); |
| 96 | + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: lookup id is ' . print_r($iLookupId, true)); | ||
| 97 | + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: behaviour id is ' . $iBehaviourId); | ||
| 96 | $sInstanceTable = KTUtil::getTableName('field_value_instances'); | 98 | $sInstanceTable = KTUtil::getTableName('field_value_instances'); |
| 97 | $sBehaviourOptionsTable = KTUtil::getTableName('field_behaviour_options'); | 99 | $sBehaviourOptionsTable = KTUtil::getTableName('field_behaviour_options'); |
| 98 | $aQuery = array( | 100 | $aQuery = array( |
| @@ -102,6 +104,11 @@ class KTValueInstance extends KTEntity { | @@ -102,6 +104,11 @@ class KTValueInstance extends KTEntity { | ||
| 102 | array($iBehaviourId, $iLookupId), | 104 | array($iBehaviourId, $iLookupId), |
| 103 | ); | 105 | ); |
| 104 | $iId = DBUtil::getOneResultKey($aQuery, 'instance_id'); | 106 | $iId = DBUtil::getOneResultKey($aQuery, 'instance_id'); |
| 107 | + if (PEAR::isError($iId)) { | ||
| 108 | + $GLOBALS['default']->log->error('KTValueInstance::getByLookupAndParentBehaviour: error from db is: ' . print_r($iId, true)); | ||
| 109 | + return $iId; | ||
| 110 | + } | ||
| 111 | + $GLOBALS['default']->log->debug('KTValueInstance::getByLookupAndParentBehaviour: id of instance is ' . $iId); | ||
| 105 | if (KTUtil::arrayGet($aOptions, 'ids')) { | 112 | if (KTUtil::arrayGet($aOptions, 'ids')) { |
| 106 | return $iId; | 113 | return $iId; |
| 107 | } | 114 | } |