Error when installing/discovering new template

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

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.
vrieskist
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Apr 04, 2012 7:19 am

Error when installing/discovering new template

Postby vrieskist » Wed Apr 04, 2012 7:25 am

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: Select all

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.

vrieskist
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Apr 04, 2012 7:19 am

Re: Error when installing/discovering new template

Postby vrieskist » Wed Apr 04, 2012 7:50 am

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.

Evoweb
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Apr 04, 2012 2:24 pm

Re: Error when installing/discovering new template

Postby Evoweb » Wed Apr 04, 2012 2:33 pm

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

User avatar
goslingcools
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Fri Jan 16, 2009 9:21 pm
Location: Netherlands, The Hague
Contact:

Re: Error when installing/discovering new template

Postby goslingcools » Fri Apr 06, 2012 4:13 am

Same error here too. (Joomla 2.5.4)

Code: Select all

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

vrieskist
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Apr 04, 2012 7:19 am

Re: Error when installing/discovering new template

Postby vrieskist » Fri Apr 06, 2012 9:18 am

Don't have the solution yet.

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

User avatar
goslingcools
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Fri Jan 16, 2009 9:21 pm
Location: Netherlands, The Hague
Contact:

Re: Error when installing/discovering new template

Postby goslingcools » Fri Apr 06, 2012 9:29 am

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

arielmorry
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Dec 15, 2011 4:12 pm

Re: Error when installing/discovering new template

Postby arielmorry » Fri Apr 06, 2012 11:25 am

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 :)

User avatar
goslingcools
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Fri Jan 16, 2009 9:21 pm
Location: Netherlands, The Hague
Contact:

Re: Error when installing/discovering new template

Postby goslingcools » Fri Apr 06, 2012 11:55 am

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

arielmorry
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Dec 15, 2011 4:12 pm

Re: Error when installing/discovering new template

Postby arielmorry » Fri Apr 06, 2012 4:31 pm

temp change:
"un-comment those lines back".

:)

vrieskist
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Apr 04, 2012 7:19 am

Re: Error when installing/discovering new template

Postby vrieskist » Sat Apr 07, 2012 8:02 am

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.

User avatar
goslingcools
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Fri Jan 16, 2009 9:21 pm
Location: Netherlands, The Hague
Contact:

Re: Error when installing/discovering new template

Postby goslingcools » Sat Apr 07, 2012 9:53 am

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: Select all

<?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

tdrynda
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Apr 09, 2012 12:13 pm

Re: Error when installing/discovering new template

Postby tdrynda » Mon Apr 09, 2012 12:52 pm

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: Select all

...
   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

User avatar
smapan
Joomla! Ace
Joomla! Ace
Posts: 1877
Joined: Wed Mar 07, 2007 6:19 am
Location: Online marketing in Thailand.
Contact:

Re: Error when installing/discovering new template

Postby smapan » Tue Apr 10, 2012 7:46 am

thank you "tdrynda"

it's work.
Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ.

ice5192
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Jun 21, 2011 9:07 am

Re: Error when installing/discovering new template

Postby ice5192 » Tue Apr 10, 2012 8:29 am

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, [email protected] 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.

User avatar
smapan
Joomla! Ace
Joomla! Ace
Posts: 1877
Joined: Wed Mar 07, 2007 6:19 am
Location: Online marketing in Thailand.
Contact:

Re: Error when installing/discovering new template

Postby smapan » Tue Apr 10, 2012 8:43 am

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 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ.

jennied53
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Sat Aug 21, 2010 1:45 pm

Re: Error when installing/discovering new template

Postby jennied53 » Mon May 14, 2012 4:22 pm

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!

beormalte
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jun 11, 2012 4:29 pm

Re: Error when installing/discovering new template

Postby beormalte » Mon Jun 11, 2012 4:41 pm

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?

beormalte
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jun 11, 2012 4:29 pm

Re: Error when installing/discovering new template

Postby beormalte » Wed Jun 13, 2012 9:09 am

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

ChrisRArendt
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Jun 16, 2012 12:49 am

Re: Error when installing/discovering new template

Postby ChrisRArendt » Sat Jun 16, 2012 12:51 am

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.

Freddy63
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 04, 2012 5:06 pm
Location: Sri Lanka
Contact:

Re: Error when installing/discovering new template

Postby Freddy63 » Wed Jul 04, 2012 5:12 pm

un-commenting did the trick thanks!

User avatar
fbcyborg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 183
Joined: Sat May 26, 2007 9:55 am
Location: Rome, Italy

Re: Error when installing/discovering new template

Postby fbcyborg » Sat Oct 27, 2012 11:15 am

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

pbbiet
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Dec 19, 2012 3:07 am
Location: India

Re: Error when installing/discovering new template

Postby pbbiet » Wed Jan 02, 2013 5:07 pm

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: Select all

...
   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

simit
I've been banned!
Posts: 33
Joined: Tue Apr 09, 2013 10:42 am

Re: Error when installing/discovering new template

Postby simit » Fri Jul 12, 2013 1:28 pm

I have many of these problems!
Please introduce a resource that would help in the installation and update Joomla Templates
Thank you


Return to “Templates for Joomla! 2.5”

Who is online

Users browsing this forum: No registered users and 6 guests