Commit eb4f12e050b363fe92c693f56dee48b1a9204b88

Authored by Conrad Vermeulen
1 parent 20b2ec3a

"KTS-2077"

"Unit test failing for tagcloud triggers"
Fixed. Checked that the arrays are correct.

Reviewed By: Jalaloedien Abrahams

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6727 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/tagcloud/TagCloudPlugin.php
@@ -223,7 +223,11 @@ class KTAddDocumentTrigger { @@ -223,7 +223,11 @@ class KTAddDocumentTrigger {
223 $tagString = ''; 223 $tagString = '';
224 // add tags 224 // add tags
225 if ($sTags) { 225 if ($sTags) {
226 - foreach($aMeta['metadata'] as $aMetaData){ 226 + if (count($aMeta['metadata']) > 0)
  227 + {
  228 + foreach($aMeta['metadata'] as $aMetaData)
  229 + {
  230 +
227 $oProxy = $aMetaData[0]; 231 $oProxy = $aMetaData[0];
228 if($oProxy->iId == $sTags){ 232 if($oProxy->iId == $sTags){
229 $tagString = $aMetaData[1]; 233 $tagString = $aMetaData[1];
@@ -333,11 +337,15 @@ class KTEditDocumentTrigger { @@ -333,11 +337,15 @@ class KTEditDocumentTrigger {
333 } 337 }
334 $tagString = ''; 338 $tagString = '';
335 if ($sTags) { 339 if ($sTags) {
336 - foreach($aMeta as $aMetaData){  
337 - $oProxy = $aMetaData[0];  
338 - if($oProxy->iId == $sTags){  
339 - $tagString = $aMetaData[1];  
340 - break; 340 + // it is actually correct using $aMeta. It is different to the add trigger above...
  341 + if (count($aMeta) > 0)
  342 + {
  343 + foreach($aMeta as $aMetaData)
  344 + {
  345 + $oProxy = $aMetaData[0];
  346 + if($oProxy->iId == $sTags){
  347 + $tagString = $aMetaData[1];
  348 + break;
341 } 349 }
342 } 350 }
343 if($tagString != ''){ 351 if($tagString != ''){