Commit db477aa4d3abc5ce5f6e1ae9626a65ddb1b3ea2b
1 parent
f17ec0fb
Deal with cases where there is no master field set on a conditional
fieldset. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4959 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
0 deletions
lib/metadata/metadatautil.inc.php
| @@ -131,10 +131,16 @@ class KTMetadataUtil { | @@ -131,10 +131,16 @@ class KTMetadataUtil { | ||
| 131 | 131 | ||
| 132 | if (empty($aCurrentSelections)) { | 132 | if (empty($aCurrentSelections)) { |
| 133 | $oField =& DocumentField::get($oFieldset->getMasterFieldId()); | 133 | $oField =& DocumentField::get($oFieldset->getMasterFieldId()); |
| 134 | + if (PEAR::isError($oField)) { | ||
| 135 | + return array(); | ||
| 136 | + } | ||
| 134 | return array($oField->getId() => array('field' => $oField, 'values' => $oField->getValues())); | 137 | return array($oField->getId() => array('field' => $oField, 'values' => $oField->getValues())); |
| 135 | } | 138 | } |
| 136 | 139 | ||
| 137 | $oMasterField =& DocumentField::get($oFieldset->getMasterFieldId()); | 140 | $oMasterField =& DocumentField::get($oFieldset->getMasterFieldId()); |
| 141 | + if (PEAR::isError($oMasterField)) { | ||
| 142 | + return array(); | ||
| 143 | + } | ||
| 138 | $aSelectedFields = array_keys($aCurrentSelections); | 144 | $aSelectedFields = array_keys($aCurrentSelections); |
| 139 | 145 | ||
| 140 | $field = $oMasterField->getId(); | 146 | $field = $oMasterField->getId(); |