Articles

Print

Joomla Templates getItems() Issue

Written by Joshua Lyon on .

If you start getting template errors (specifically with JoomlaArt templates) like the one below, just replace the lines of code listed below. I've noticed this happen on JA_Fagus and JA_Purity... although I think JA_Purity was fixed in the 1.5.6 Joomla packages.

Fatal error: Call to a member function getItems() on a non-object in /***/templates/ja_***/ja_menus/Base.class.php on line ***. 

Open up the file that has the error in it and look for the following line:

$menu = @JMenu :: getInstance(); 

And replace it with:

$menu = &JSite::getMenu(); 

Comments   

 
Some Dude
0 #7 Some Dude 2010-10-27 07:12
You are a Genius...thanks so much:D:D:D:D:D: D:D
Quote | Report to administrator
 
 
Oscar
0 #6 Oscar 2010-06-17 11:10
Definitivamente funciono.
Quote | Report to administrator
 
 
Simona
0 #5 Simona 2009-12-14 20:23
i`ve changed line 21 but it appears another error at line 34
Warning: Invalid argument supplied for foreach() in C:-xampphtdocsJ oomla150 emplatesja_puri tyja_menusBase. class.php on line 34

line34: foreach ($items as $index=> $v) {
Quote | Report to administrator
 
 
 
 
philsu
0 #3 philsu 2009-12-07 02:10
Thanks for Lyon's code, I've install the "Ja_fagus" template,
and the top-menu cannot be viewed,is show that:

Warning: Invalid argument supplied for foreach() in ...templatesja_ fagusja_menusBa se.class.php on line 30

I couldn't find the way to solve it, help me please :-)
Quote | Report to administrator
 
 
pearllysun
0 #2 pearllysun 2009-10-26 12:10
many thanks buddy , i checked atleast a dozen website's to find this fix but atlast when i felt to totally abandon this template ur info assisted me a lot & helped me resume the template . thanks .
Quote | Report to administrator
 
 
FiulPloii
0 #1 FiulPloii 2009-07-11 10:06
Great stuff! Solved my problem. Cheers!
Quote | Report to administrator