Commit 2208336f5185d5cca8aa04b66662dc73f313eb2f

Authored by megan_w
1 parent 0d549410

KTS-2723

"The Search Portlet is not displaying in the browse view"
Fixed. Used serialise instead of implode / explode.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.4.5-Release-Branch@7726 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/plugins/plugin.inc.php
@@ -78,9 +78,9 @@ class KTPlugin { @@ -78,9 +78,9 @@ class KTPlugin {
78 78
79 // Register helper in DB 79 // Register helper in DB
80 if(is_array($aLocation)){ 80 if(is_array($aLocation)){
81 - $sLocation = implode('_|', $aLocation); 81 + $aLocation = serialize($aLocation);
82 } 82 }
83 - $params = $sLocation.'|'.$sPortletClassName.'|'.$sPortletNamespace.'|'.$sFilename.'|'.$this->sNamespace; 83 + $params = $aLocation.'|'.$sPortletClassName.'|'.$sPortletNamespace.'|'.$sFilename.'|'.$this->sNamespace;
84 $this->registerPluginHelper($sPortletNamespace, $sPortletClassName, $sFilename, $params, 'general', 'portlet'); 84 $this->registerPluginHelper($sPortletNamespace, $sPortletClassName, $sFilename, $params, 'general', 'portlet');
85 } 85 }
86 86
@@ -280,10 +280,10 @@ class KTPlugin { @@ -280,10 +280,10 @@ class KTPlugin {
280 280
281 // Register helper in DB 281 // Register helper in DB
282 if(is_array($aInitialize)){ 282 if(is_array($aInitialize)){
283 - $sInitialize = implode('_|', $aInitialize); 283 + $aInitialize = serialize($aInitialize);
284 } 284 }
285 285
286 - $params = $sClassName.'|'.$sNamespace.'|'.$sFilename.'|'.$sInitialize; 286 + $params = $sClassName.'|'.$sNamespace.'|'.$sFilename.'|'.$aInitialize;
287 $this->registerPluginHelper($sNamespace, $sClassName, $sFilename, $params, 'general', 'criterion'); 287 $this->registerPluginHelper($sNamespace, $sClassName, $sFilename, $params, 'general', 'criterion');
288 } 288 }
289 289
@@ -396,8 +396,11 @@ class KTPlugin { @@ -396,8 +396,11 @@ class KTPlugin {
396 396
397 switch ($sClassType) { 397 switch ($sClassType) {
398 case 'portlet': 398 case 'portlet':
399 - $aLocation = explode('_|', $aParams[0]);  
400 - $aParams[0] = $aLocation; 399 + $aLocation = unserialize($aParams[0]);
  400 + if($aLocation !== false){
  401 + $aParams[0] = $aLocation;
  402 + }
  403 +
401 $this->_aPortlets[$sName] = $aParams; 404 $this->_aPortlets[$sName] = $aParams;
402 break; 405 break;
403 406
@@ -466,8 +469,11 @@ class KTPlugin { @@ -466,8 +469,11 @@ class KTPlugin {
466 break; 469 break;
467 470
468 case 'criterion': 471 case 'criterion':
469 - $aInit = explode('_|', $aParams[3]);  
470 - $aParams[3] = $aInit; 472 + $aInit = unserialize($aParams[3]);
  473 + if($aInit !== false){
  474 + $aParams[3] = $aInit;
  475 + }
  476 +
471 $this->_aCriteria[$sName] = $aParams; 477 $this->_aCriteria[$sName] = $aParams;
472 break; 478 break;
473 479
lib/plugins/pluginutil.inc.php
@@ -171,8 +171,11 @@ class KTPluginUtil { @@ -171,8 +171,11 @@ class KTPluginUtil {
171 171
172 switch ($sClassType) { 172 switch ($sClassType) {
173 case 'portlet': 173 case 'portlet':
174 - $aLocation = explode('_|', $aParams[0]);  
175 - $aParams[0] = $aLocation; 174 + $aLocation = unserialize($aParams[0]);
  175 + if($aLocation !== false){
  176 + $aParams[0] = $aLocation;
  177 + }
  178 +
176 call_user_func_array(array(&$oPRegistry, 'registerPortlet'), $aParams); 179 call_user_func_array(array(&$oPRegistry, 'registerPortlet'), $aParams);
177 break; 180 break;
178 181
@@ -241,8 +244,10 @@ class KTPluginUtil { @@ -241,8 +244,10 @@ class KTPluginUtil {
241 break; 244 break;
242 245
243 case 'criterion': 246 case 'criterion':
244 - $aInit = explode('_|', $aParams[3]);  
245 - $aParams[3] = $aInit; 247 + $aInit = unserialize($aParams[3]);
  248 + if($aInit !== false){
  249 + $aParams[3] = $aInit;
  250 + }
246 call_user_func_array(array(&$oCriteriaRegistry, 'registerCriterion'), $aParams); 251 call_user_func_array(array(&$oCriteriaRegistry, 'registerCriterion'), $aParams);
247 break; 252 break;
248 253