Commit fc98e5e00795b90344ce7da6a7df60c6d15948ce
1 parent
ed774012
Don't try build free/parent lists if the master field isn't set yet.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3788 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
15 additions
and
13 deletions
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php
| ... | ... | @@ -231,20 +231,22 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { |
| 231 | 231 | foreach ($aFields as $oField) { |
| 232 | 232 | $aFreeFieldIds[] = $oField->getId(); |
| 233 | 233 | } |
| 234 | - $aParentFieldIds = array($oMasterField->getId()); | |
| 235 | - foreach ($aFieldOrders as $aRow) { | |
| 236 | - $aParentFieldIds[] = $aRow['child_field_id']; | |
| 237 | - } | |
| 238 | - $aParentFields = array(); | |
| 239 | - foreach (array_unique($aParentFieldIds) as $iId) { | |
| 240 | - $aParentFields[] =& DocumentField::get($iId); | |
| 241 | - } | |
| 242 | - $aFreeFields = array(); | |
| 243 | - foreach ($aFreeFieldIds as $iId) { | |
| 244 | - if (in_array($iId, $aParentFieldIds)) { | |
| 245 | - continue; | |
| 234 | + if ($oMasterField) { | |
| 235 | + $aParentFieldIds = array($oMasterField->getId()); | |
| 236 | + foreach ($aFieldOrders as $aRow) { | |
| 237 | + $aParentFieldIds[] = $aRow['child_field_id']; | |
| 238 | + } | |
| 239 | + $aParentFields = array(); | |
| 240 | + foreach (array_unique($aParentFieldIds) as $iId) { | |
| 241 | + $aParentFields[] =& DocumentField::get($iId); | |
| 242 | + } | |
| 243 | + $aFreeFields = array(); | |
| 244 | + foreach ($aFreeFieldIds as $iId) { | |
| 245 | + if (in_array($iId, $aParentFieldIds)) { | |
| 246 | + continue; | |
| 247 | + } | |
| 248 | + $aFreeFields[] =& DocumentField::get($iId); | |
| 246 | 249 | } |
| 247 | - $aFreeFields[] =& DocumentField::get($iId); | |
| 248 | 250 | } |
| 249 | 251 | $oTemplate->setData(array( |
| 250 | 252 | 'oFieldset' => $oFieldset, | ... | ... |