Commit 5efebd2222c7d2fce6dbc3c5fc77fe54c07c22dc

Authored by Neil Blakey-Milner
1 parent 772373e4

KTS-897: don't synchronise empty items over.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5352 c91229c3-7414-0410-bfa2-8a42b809f60b
examples/fieldsynchronisation/syncFieldFromLDAP.php
... ... @@ -77,7 +77,11 @@ foreach ($aResults->entries() as $oEntry) {
77 77 // print $oEntry->dn() . "\n";
78 78 $sValue = $oEntry->get_value($sAttribute, 'single');
79 79 // print $sValue . "\n";
80   - $aValues[] = $sValue;
  80 + if (!empty($sValue)) {
  81 + $aValues[] = $sValue;
  82 + }
81 83 }
82 84  
  85 +$aValues = array_unique($aValues);
  86 +
83 87 KTMetadataUtil::synchroniseMetadata($oField, $aValues);
... ...