Гость
29 Фев 2012 05:11

Hi,

During implementation your component we have noticed three errors connected with two plugins - emcontent and emcomponent. I've a question if the used solutions are correct and don't mess the component functionalities.

1) On the restricted pages plugin emcontent (file emcontent.php) returns a warning connected with empty delimiter in function strpos around line 100. I've solved this problem by changing fragment:


foreach($bots as $bot) { if (strpos($_SERVER['HTTP_USER_AGENT'], $bot)) { return; } }

to:


foreach($bots as $bot) { if($bot) { if (strpos($_SERVER['HTTP_USER_AGENT'], $bot)) { return; } } }

2) During redirect from public page to the restricted page there is visible in short moment an error connected with the emcomponent plugin - array cannot be an argument for the explode function.

This problem was related with this line (around line 450 in emcomponent.php file):


$plans = explode(',', $plans);

I've changed it for:


if(!is_array($plans)) { $plans = explode(',', $plans); }

Then the error dissapears. I've discovered during my debugging process that sometimes variable $plans contains i.e. only "5" but sometimes it is an array: array([5] => 5) what cause the showing of this error.

3) The last problem was connected with the wrong redirection address and I've also solved it in the emcomponent.php file. In general user was redirected to page which contains in URL ampersands encoded as "&" and additionally the parameter id=5 is added at the end of the url.

In general we have no idea from where this id comes but it cause that on our page with plans it cause that no plans are visible. That's why I've changed line:


$link = "index.php?option=com_emerald&view=plans&layout=form&Itemid=".$Itemid.($sid ? "&id=".$sid : "");

for:


$link = "index.php?option=com_emerald&view=plans&layout=form&Itemid=".$Itemid;

Then plans are showing correctly and additonally the ampersands are properly encoded as "&" not as "&" in the url.

Последние изменения: 02 Март 2014


Sergey
Total posts: 13,748
29 Фев 2012 05:24

Evrything looks fine to me and enough to solve errors diaplay. We will although fix everythign you mention and with the next release you get it fixed best way. But it is ok for now how you did it.

Работает на Cobalt