The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 23 posts ] 
Author Message
PostPosted: Wed Apr 04, 2012 7:25 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 04, 2012 7:19 am
Posts: 4
Ok, so I tried to make my own template, very basic just a skeleton. But it failed to install in the discover screen. After that I tried to duplicate a default template, change the folder name, change the name in the templateDetails.xml. This also gave the same error:

Code:
Notice: Undefined variable: lang in /Users/username/Sites/sitename/libraries/joomla/installer/adapters/template.php on line 543 Fatal error: Call to a member function setDebug() on a non-object in /Users/username/Sites/sitename/libraries/joomla/installer/adapters/template.php on line 543


I'm running Joomla 2.5 on my local machine (OSX 10.7) with Apache 2, PHP5, MySQL5. I'm pretty new with Joomla, but pretty experienced in web development, but I couldn't find a solution for this problem.


Top
 Profile  
 
PostPosted: Wed Apr 04, 2012 7:50 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 04, 2012 7:19 am
Posts: 4
Ok, quick addition!
Installing the theme from a directory in the Extension Manager: Install works. So the problem is in the Discover function for installing a template. I would still like to know if this is a known bug or something.


Top
 Profile  
 
PostPosted: Wed Apr 04, 2012 2:33 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 04, 2012 2:24 pm
Posts: 1
I have the same issue.

Yesterday version 2.5.3 my custom template worked fine.

Today version 2.5.4 custom template now won’t work.

I have also tried duplicating one of the templates which come with Joomla as standard and renaming it, this also returns the same error. I have tried it on my local Windows 7 machine and on a live server, again same errors.

Discovery work fine, it is only when I try to install that I get the error.

Fatal error: Call to a member function setDebug() on a non-object in C:\xampp\htdocs\Joomla2.5\libraries\joomla\installer\adapters\template.php on line 543 (local machine)

Fatal error: Call to a member function setDebug() on a non-object in /home/evowebst/public_html/joomla/joomla2.5/libraries/joomla/installer/adapters/template.php on line 543 (Live server)

what have I missed? have I done something wrong? is it a bug with 2.5.4?

any help would be much appreciated.

thanks


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 4:13 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Jan 16, 2009 9:21 pm
Posts: 102
Location: Netherlands, The Hague
Same error here too. (Joomla 2.5.4)

Code:
Fatal error: Call to a member function setDebug() on a non-object in ... libraries/joomla/installer/adapters/template.php on line 543


Did you guys find a solution for this?

Regards,

Gosling

_________________
Gosling Cools | COBIZ webdevelopment | http://www.cobiz.nl


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 9:18 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 04, 2012 7:19 am
Posts: 4
Don't have the solution yet.

I found a workaround by installing the theme 'from directory' in the 'Extension Manager: Install' screen.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 9:29 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Jan 16, 2009 9:21 pm
Posts: 102
Location: Netherlands, The Hague
I was discovering & installing a custom J1.5 Template into a plain J2.5 site.

To get it to work, I adjusted the templateDetails.xml file to the J2.5 syntax. Zipped the template and did a normal extension install.

That worked.

_________________
Gosling Cools | COBIZ webdevelopment | http://www.cobiz.nl


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 11:25 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 15, 2011 4:12 pm
Posts: 6
go to libraries/joomla/installer/adapter/template.php
comment out lines 543 and 558 > discover and install your template > un-comment those lines back.

worked for me on joomla 2.5.4.

//$lang->setDebug($debug);
//$debug = $lang->setDebug(false);

good luck :)


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 11:55 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Jan 16, 2009 9:21 pm
Posts: 102
Location: Netherlands, The Hague
Thanks but I never change the Joomla core code. Just use overrides and (custom) extensions.
This makes updating (many) sites easy, safe and keeps them stable :-)

_________________
Gosling Cools | COBIZ webdevelopment | http://www.cobiz.nl


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 4:31 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 15, 2011 4:12 pm
Posts: 6
temp change:
"un-comment those lines back".

:)


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 8:02 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 04, 2012 7:19 am
Posts: 4
goslingcools wrote:
I was discovering & installing a custom J1.5 Template into a plain J2.5 site.

To get it to work, I adjusted the templateDetails.xml file to the J2.5 syntax. Zipped the template and did a normal extension install.

That worked.

Could you provide a link to the J2.5 template syntax? Because I think I have the template in the correct format.

The uncommenting 'fix' could work for at least installing one template and that could be enough, but is not a lasting/durable solution.


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 9:53 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Jan 16, 2009 9:21 pm
Posts: 102
Location: Netherlands, The Hague
This is what I used. Very basic.

Make sure that the <name> is the same as your template folder (for example mytemplate_tpl)

Never mind the install PUBLIC "-//Joomla! 1.6/, that worked fine with me.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
<extension version="2.5" type="template" client="site">
    <name>mytemplate_tpl</name>
    <creationDate>...</creationDate>
    <author>...</author>
    <authorEmail>...</authorEmail>
    <authorUrl>....</authorUrl>
    <copyright>Copyright (C) 2012 ...</copyright>
    <license>GPL</license>
    <version>1.0</version>
    <description></description>
    <files>
        <filename>index.php</filename>
        <filename>favicon.ico</filename>
        <filename>index.html</filename>
        <filename>component.php</filename>
        <filename>params.ini</filename>
        <filename>template_thumbnail.png</filename>
        <filename>templateDetails.xml</filename>
        <folder>html</folder>
        <folder>images</folder>      
        <folder>css</folder>
        <folder>js</folder>
    </files>
    <positions>
        <position>left</position>
        <position>right</position>
    </positions>
    <config>
        <fields name="params">
            <fieldset name="basic">
            </fieldset>
        </fields>
    </config>
</extension>

_________________
Gosling Cools | COBIZ webdevelopment | http://www.cobiz.nl


Top
 Profile  
 
PostPosted: Mon Apr 09, 2012 12:52 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Apr 09, 2012 12:13 pm
Posts: 1
The error message "Undefined variable: lang in .../libraries/joomla/installer/adapters/template.php on line 543" is caused by a bug in the Joomla code. It only exists in version 2.5.4.

The variable $lang has not been correctly initialised in the function "discover_install()" in the file mentioned above.

The bug has been reported fixed for the next release and is detailed here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=28345

The fix, as outlined in the bug report is to add the line "$lang = JFactory::getLanguage();" to the installed Joomla code like this:
Code:
...
   public function discover_install()
   {
      $lang = JFactory::getLanguage();
      // Templates are one of the easiest
...

Obviously you should only do that if you're confident and sure you know what you're doing. Make backups, before attempting it.

Hope that helps!

Tom


Top
 Profile  
 
PostPosted: Tue Apr 10, 2012 7:46 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Wed Mar 07, 2007 6:19 am
Posts: 1877
Location: Online marketing in Thailand.
thank you "tdrynda"

it's work.

_________________
Tel 085-073-6776 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ.
http://www.apartment.in.th ค้นหาให้เช่าที่พักของประเทศไทย.
http://www.jwebengine.com/freeweb UnlimitedSpace+FreeHost+FreeDomain ขอทดลองใช้ได้


Top
 Profile  
 
PostPosted: Tue Apr 10, 2012 8:29 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 21, 2011 9:07 am
Posts: 11
since doing this i get this now thanks Joolma

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@tgclan99.tgclan.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Top
 Profile  
 
PostPosted: Tue Apr 10, 2012 8:43 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Wed Mar 07, 2007 6:19 am
Posts: 1877
Location: Online marketing in Thailand.
my case was fixed by this step
1.edit file "/libraries/joomla/installer/adapters/template.php" (Thank to "tdrynda").
2.Change langue to English and
3.double check template name is same as template folder (Thank to "goslingcools").

_________________
Tel 085-073-6776 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ.
http://www.apartment.in.th ค้นหาให้เช่าที่พักของประเทศไทย.
http://www.jwebengine.com/freeweb UnlimitedSpace+FreeHost+FreeDomain ขอทดลองใช้ได้


Top
 Profile  
 
PostPosted: Mon May 14, 2012 4:22 pm 
Joomla! Intern
Joomla! Intern

Joined: Sat Aug 21, 2010 1:45 pm
Posts: 71
goslingcools wrote:
I was discovering & installing a custom J1.5 Template into a plain J2.5 site.

To get it to work, I adjusted the templateDetails.xml file to the J2.5 syntax. Zipped the template and did a normal extension install.

That worked.


This also worked for me. Thanks for posting this info, it saved me!


Top
 Profile  
 
PostPosted: Mon Jun 11, 2012 4:41 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Jun 11, 2012 4:29 pm
Posts: 2
Ok, so I am reading the Joomla Programming book too, and I am also having the same issue duplicating the beez template.
When ever I use the discover tool and click the install icon after appropriately copying the beez template and renaming it to beez_copy. I get this page:

The website encountered an error while retrieving http://localhost:8888/Joomla-Site/admin ... w=discover. It may be down for maintenance or configured incorrectly.

I know that all the files have been changed correctly because I have downloaded and used the finished sample from http://joomlaprogrammingbook.com/images ... 0_copy.zip .

I also copied the language files in the /language/en-GB directory.

So any ideas anyone?


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 9:09 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Jun 11, 2012 4:29 pm
Posts: 2
Joomla Apprentice has it right :-)

go to libraries/joomla/installer/adapter/template.php
comment out lines 543 and 558 > discover and install your template > un-comment those lines back.

worked for me on joomla 2.5.4.

//$lang->setDebug($debug);
//$debug = $lang->setDebug(false);

good luck


Top
 Profile  
 
PostPosted: Sat Jun 16, 2012 12:51 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sat Jun 16, 2012 12:49 am
Posts: 1
Thanks everyone for the help. The code change fix worked for me and was relatively straightforward. Since this is slated to be fixed I figured it was an okay change to make.


Top
 Profile  
 
PostPosted: Wed Jul 04, 2012 5:12 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Jul 04, 2012 5:06 pm
Posts: 1
Location: Sri Lanka
un-commenting did the trick thanks!


Top
 Profile  
 
PostPosted: Sat Oct 27, 2012 11:15 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sat May 26, 2007 9:55 am
Posts: 183
Location: Rome, Italy
Hello,

I had this problem too after a migration from Joomla! 1.5 to Joomla! 2.5.
This is the error message:

Fatal error: Call to a member function get() on a non-object in /var/www/localhost/htdocs/website/jupgrade/templates/beez_20/index.php on line 119

beormalte wrote:
Joomla Apprentice has it right :-)

go to libraries/joomla/installer/adapter/template.php
comment out lines 543 and 558 > discover and install your template > un-comment those lines back.

worked for me on joomla 2.5.4.

//$lang->setDebug($debug);
//$debug = $lang->setDebug(false);

good luck


The above trick didn't work for me.
What to do?


EDIT: solved. I forgot to change dbprefix to j25 after migration :D


Top
 Profile  
 
PostPosted: Wed Jan 02, 2013 5:07 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Dec 19, 2012 3:07 am
Posts: 10
Location: India
tdrynda wrote:
The fix, as outlined in the bug report is to add the line "$lang = JFactory::getLanguage();" to the installed Joomla code like this:
Code:
...
   public function discover_install()
   {
      $lang = JFactory::getLanguage();
      // Templates are one of the easiest
...

Obviously you should only do that if you're confident and sure you know what you're doing. Make backups, before attempting it.


Thanks Tom for this, It helps


Top
 Profile  
 
PostPosted: Fri Jul 12, 2013 1:28 pm 
I've been banned!

Joined: Tue Apr 09, 2013 10:42 am
Posts: 34
I have many of these problems!
Please introduce a resource that would help in the installation and update Joomla Templates
Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group