Commit c2fb7d6462f84e58eead10c8c4d7c217e87552ac

Authored by nbm
1 parent 43d3281a

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);
... ...