The following error occurs running the dhtmlxSpreadsheet plugin with Joomla 2.5.
A missing parameter for the variable “$limitstart” in the plugin file “spreadsheet.php” leads to the following error in the media library of the backend of Joomla 2.5:
To fix the bug, you have to add the value “0” to the variable “$limitstart” in line 38 and 46 of the file “spreadsheet.php”.
Original file content, before correction [line 38 to 52]:
public function onBeforeDisplayContent(&$article, &$params, $limitstart) {
global $mainframe;
if (isset($article->text))
$article->text = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->text);
if (isset($article->introtext))
$article->introtext = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->introtext);
}
public function onContentBeforeDisplay($context, &$article, &$params, $limitstart) {
global $mainframe;
if (isset($article->text))
$article->text = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->text);
if (isset($article->introtext))
$article->introtext = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->introtext);
}
Fixed code, with the parameter “$limitstart = 0” [line 38 to 52]
public function onBeforeDisplayContent(&$article, &$params, $limitstart = 0) {
global $mainframe;
if (isset($article->text))
$article->text = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->text);
if (isset($article->introtext))
$article->introtext = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->introtext);
}
public function onContentBeforeDisplay($context, &$article, &$params, $limitstart = 0) {
global $mainframe;
if (isset($article->text))
$article->text = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->text);
if (isset($article->introtext))
$article->introtext = preg_replace_callback($this->sh_cfg->get('pattern'), Array($this, "replace"), $article->introtext);
}
This should fix the error in the backend! If not, please add post to this thread.