Page 1 of 1

Fatal error: Call to undefined method JDocumentError::countM

Posted: 09 Dec 2014, 20:37
by speerwolf
Hello,

i´m having a problem with the Phoca Guestbook extension. It works all very good, but when i want to post a new item, there always comes this message:
Fatal error: Call to undefined method JDocumentError::countModules() in /www/htdocs/w00bf5a6/rohrhof-jakob.de/templates/j51_calibra/php/config.php on line 6
I´m using a commercial template from Joomla51. I already tried to solve the issue with the developers there, but they couldn´t fix it.
Can someone help me?

For live testing please try it on the following link:
rohrhof-jakob.jakob-rohrhof.de/gaestebuch

Thank you and best regards,
Tobias

Re: Fatal error: Call to undefined method JDocumentError::co

Posted: 09 Dec 2014, 20:45
by Jan
Hi, this error is coming from this file:
templates/j51_calibra/php/config.php

The file is a part of your template and I don't know this file and cannot check it as it is a template file so really cannot give any clue advice what is wrong in the config file of the template. :idea:

Why the template developers cannot fix this error? This seems like something is calling a method/class which was not loaded there :idea:

Jan

Re: Fatal error: Call to undefined method JDocumentError::co

Posted: 10 Dec 2014, 19:29
by speerwolf
Hello,

i don´t know why they can´t fix it. They tried to replace $this with $doc. Don´t know what that should do? But it didn´t work.
Here is the Code of the PHP file. The problem should be in line 6, like the message said? Any clue?

Code: Select all

<?php


//COUNT MODULES IN TOP-1 - DECIDE WIDTH - COLLAPSE IF NECESSARY 
$top1_counted = 0;
if ($this->countModules('top-1a')) $top1_counted++;
if ($this->countModules('top-1b')) $top1_counted++;
if ($this->countModules('top-1c')) $top1_counted++;
if ($this->countModules('top-1d')) $top1_counted++;
if ($this->countModules('top-1e')) $top1_counted++;
if ($this->countModules('top-1f')) $top1_counted++;
if ( $top1_counted == 6 ) {
	$top1_width = '16.66%';}
else if ( $top1_counted == 5 ) {
	$top1_width = '20%';
} else if ($top1_counted == 4) {
	$top1_width = '25%';
} else if ($top1_counted == 3) {
	$top1_width = '33.3%';
} else if ($top1_counted == 2) {
	$top1_width = '50%';
} else if ($top1_counted == 1) {
	$top1_width = '100%';
}

//COUNT MODULES IN TOP-2 - DECIDE WIDTH - COLLAPSE IF NECESSARY
$top2_counted = 0;
if ($this->countModules('top-2a')) $top2_counted++;
if ($this->countModules('top-2b')) $top2_counted++;
if ($this->countModules('top-2c')) $top2_counted++;
if ($this->countModules('top-2d')) $top2_counted++;
if ($this->countModules('top-2e')) $top2_counted++;
if ($this->countModules('top-2f')) $top2_counted++;
if ( $top2_counted == 6 ) {
	$top2_width = '16.66%';
}
else if ( $top2_counted == 5 ) {
	$top2_width = '20%';
} else if ($top2_counted == 4) {
	$top2_width = '25%';
} else if ($top2_counted == 3) {
	$top2_width = '33.3%';
} else if ($top2_counted == 2) {
	$top2_width = '50%';
} else if ($top2_counted == 1) {
	$top2_width = '100%';
}



Re: Fatal error: Call to undefined method JDocumentError::co

Posted: 12 Dec 2014, 15:02
by Jan
Hi,
$this->countModules('xxx'); is standard function which should normally work in template index.php so there should not be any problem. But maybe this is related to config.php - if the config.php is a part of the template system and if it has the same variables and parameters as the index.php :idea:

Check if the config.php is properly included in the system :idea:

Jan

Re: Fatal error: Call to undefined method JDocumentError::co

Posted: 12 Dec 2014, 21:22
by speerwolf
I solved the Problem. I imported my old guestbook items from 1.5 and there I forgot to set the catid for root to in the database.
Now everything works. I apologize for the inconvenience.
Thanks alot.

Re: Fatal error: Call to undefined method JDocumentError::co

Posted: 17 Dec 2014, 02:54
by Jan
Ok