Commit f735f6e9c1b60df47e62e2bad2c8d9a105013e6a

Authored by bryndivey
1 parent f124912a

KTS-1264


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5801 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktcore/admin/documentFields.php
... ... @@ -164,16 +164,18 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
164 164  
165 165 $this->startTransaction();
166 166  
167   - if ($bGeneric != $oFieldset->getIsGeneric) {
168   - // delink it from all doctypes.
169   - $aTypes = $oFieldset->getAssociatedTypes();
170   - foreach ($aTypes as $oType) {
171   - $res = KTMetadataUtil::removeSetsFromDocumentType($oType, $oFieldset->getId());
172   - if (PEAR::isError($res)) {
173   - $this->errorRedirectTo('edit', _kt('Could not save fieldset changes'), 'fFieldsetId=' . $oFieldset->getId());
174   - exit(0);
175   - }
176   - }
  167 + // if we're BECOMING generic
  168 + if ($bGeneric != $oFieldset->getIsGeneric() && $bGeneric == true) {
  169 + // delink it from all doctypes.
  170 + $aTypes = $oFieldset->getAssociatedTypes();
  171 +
  172 + foreach ($aTypes as $oType) {
  173 + $res = KTMetadataUtil::removeSetsFromDocumentType($oType, $oFieldset->getId());
  174 + if (PEAR::isError($res)) {
  175 + $this->errorRedirectTo('edit', _kt('Could not save fieldset changes'), 'fFieldsetId=' . $oFieldset->getId());
  176 + exit(0);
  177 + }
  178 + }
177 179 }
178 180  
179 181 $oFieldset->setName($sName);
... ...