2.5.4:Error when using Discover->Install to install template

The support for Joomla 2.5 ended on December 31, 2014. Possible bugs in Joomla 2.5 will not be patched anymore. This forum has been closed. Please update your website to Joomla 3.x

Moderators: ooffick, dam-man

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
User avatar
dilbert4life
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Jul 10, 2009 3:41 pm
Location: Crystal Lake, IL
Contact:

2.5.4:Error when using Discover->Install to install template

Postby dilbert4life » Mon Apr 02, 2012 6:19 pm

On line 543 of /libraries/joomla/installer/adapters/template.php there is a call
to the $lang object, but that object doesn't exist. Within the
discover_install() function, there is no call to $lang =
JFactory::getLanguage(). This causes the template install via Discover to fail.
The template partially intalls, but no Style is created, so you can't actually
use the template.

View tracker here - http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28345
Joomla! Framework Team
Joomla! Production Leadership Team
http://dongilbert.net
Follow me on twitter @dilbert4life

User avatar
dilbert4life
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Jul 10, 2009 3:41 pm
Location: Crystal Lake, IL
Contact:

Re: Fatal Error when using Discover->Install to install temp

Postby dilbert4life » Mon Apr 02, 2012 6:43 pm

Also, added a pull request on github - https://github.com/joomla/joomla-cms/pull/174
Joomla! Framework Team
Joomla! Production Leadership Team
http://dongilbert.net
Follow me on twitter @dilbert4life

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Fatal Error when using Discover->Install to install temp

Postby infograf768 » Tue Apr 03, 2012 6:48 am

Thanks.
I moved the tracker to RTC

Replace
/libraries/joomla/installer/adapters/template.php

by the attached file, after decompressing
template.php.zip
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

tristicles
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Apr 10, 2012 2:33 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby tristicles » Tue Apr 10, 2012 3:02 pm

Hi folks. Just ran into this problem. Have tried updating template.php with infograf768's replacement (I see he's added the fix dilbert4life suggested on the joomlatracker post) and that doesn't seem to work, either. With this new version, I just get a blank screen when I hit the "Discover" icon in the discover section. It doesn't even find my template to add it in.

Unfortunately, I don't understand the "style" of PHP that Joomla is written in (I'm guessing OOP) so I can't offer anything more constructive.

Please forgive my stupidity, but how else can I add a template in? This discovery option is the only way I've managed to get it to work so far.

Many thanks

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: 2.5.4:Error when using Discover->Install to install temp

Postby infograf768 » Tue Apr 10, 2012 3:23 pm

Your template should be installable through Extension Manager=>Install.
The discover funtion is useful when an extension is too large.

The patch is now committed to trunk.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
dilbert4life
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Jul 10, 2009 3:41 pm
Location: Crystal Lake, IL
Contact:

Re: 2.5.4:Error when using Discover->Install to install temp

Postby dilbert4life » Tue Apr 10, 2012 3:37 pm

Cool that they committed it to trunk - I've been dev'ing with Joomla! for the past 5 years, but this is the first core contribution I've made. I'll continue to submit things as I find them.
Joomla! Framework Team
Joomla! Production Leadership Team
http://dongilbert.net
Follow me on twitter @dilbert4life

tristicles
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Apr 10, 2012 2:33 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby tristicles » Tue Apr 10, 2012 3:50 pm

Have managed to "upload" the template (it's only an intranet site, so I've got full access to the server) to the /tmp folder and hoover it in from there.

Many thanks for your help.

zippity
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Thu May 10, 2007 9:54 am

Re: 2.5.4:Error when using Discover->Install to install temp

Postby zippity » Sat Apr 21, 2012 9:26 am

Thank you for the fix. I was finally able to get my template installed using the Discover method after making the change to the template.php file.

However I wanted to say that this was the ONLY way I was able to install my template, which was a heavily modified template based on the beez5 template. I was not able to install in the Extensions Manager>Install section.

When I tried to upload with Browse, I got the messages "Unable to write entry" and "Unable to find install package".

When I tried to upload via the Directory, I got the message "Please enter a package directory".

When I tried to upload via URL, I got the message "Unable to write entry".

If anyone can tell me why I might be having such problems, I would greatly appreciate it.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: 2.5.4:Error when using Discover->Install to install temp

Postby infograf768 » Sat Apr 21, 2012 9:52 am

zippity wrote:Thank you for the fix. I was finally able to get my template installed using the Discover method after making the change to the template.php file.

However I wanted to say that this was the ONLY way I was able to install my template, which was a heavily modified template based on the beez5 template. I was not able to install in the Extensions Manager>Install section.

When I tried to upload with Browse, I got the messages "Unable to write entry" and "Unable to find install package".

When I tried to upload via the Directory, I got the message "Please enter a package directory".

When I tried to upload via URL, I got the message "Unable to write entry".

If anyone can tell me why I might be having such problems, I would greatly appreciate it.

Post here a zip of your template, as it is hard to help without testing it.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

rogerco
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Tue Jan 23, 2007 8:56 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby rogerco » Tue Apr 24, 2012 12:41 pm

infograf768 wrote:Your template should be installable through Extension Manager=>Install.
The discover funtion is useful when an extension is too large.

I thought - but please correct me if I'm wrong - that 'Discover' was also really useful if you want to make a copy of an existing template (or other things I guess) as a starting point for modifications.

Since core templates are prone to getting modified in upgrades I always start by making a copy of whichever template I am going to use as a starting point and discovering that so as to have my own version to mess with.

There may even be a utility to automate this - as a minimum it just involves copying all the files to a newname folder in templates and changing the name to newname in three places in the xml file, renaming the two langauge files to newname and copying them to the language folder. Then discover should automatically find and 'install' the newname template - a really useful new feature over 1.5

There is a duplicate template style option provided in the backend - it would be really useful if there was also a duplicate template option which did this.

RogerCO

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: 2.5.4:Error when using Discover->Install to install temp

Postby infograf768 » Wed May 09, 2012 6:04 am

See this new proposed feature, test and comment:

http://joomlacode.org/gf/project/joomla ... m_id=28472
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

rogerco
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Tue Jan 23, 2007 8:56 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby rogerco » Wed May 09, 2012 8:03 pm

That looks ideal from the description and I'd be happy to test it and report back but there only seems to be a ".patch" file to download and when I look at it with a text editor it appears to be some replacement or additional bits for various files but every line is preceded with a '+' character so you can't simply copy and paste it into the existing files to test it. Is there any way of adding the contents of a .patch file to an existing installation?

I did try searching on the Joomlacode and the Developer site but came up with no simple explanation.

Sorry for the naive beginner's question but if I can't test it then I guess I'll have to wait until the great and the good pronounce it fine and include it in a future release. Perhaps I'd better go and google 'patch file format' in case it is some widely used common thing that I've simply not come across before and you are all laughing at my ignorance...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: 2.5.4:Error when using Discover->Install to install temp

Postby infograf768 » Thu May 10, 2012 8:50 am

To use a patch, one needs a SVN or git client.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

rogerco
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Tue Jan 23, 2007 8:56 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby rogerco » Thu May 10, 2012 10:13 am

ah thanks. I use SVN at work but have never come across patch files before (they probably get hidden by the IDE), and can't do home stuff at work so will have to wait till it gets released. (for a single developer I find SVN more hassle than its worth for small projects outside paid work - but then I still use a plain text editor for PHP so I guess I'm a bit old fashioned)

Many thanks for getting this improvement into the core development.

wyrix
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Nov 08, 2011 1:37 pm

Re: 2.5.4:Error when using Discover->Install to install temp

Postby wyrix » Fri May 11, 2012 11:01 am

May I ask why the debugging state of the Language class have to be changed?
The Language class is not used at all in the discover_install() method.
I think the developer just wanted to change the debugging state of the Database class?

But the template will be installed correctly when you remove the following lines of the discover_install() method;

Code: Select all

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

Code: Select all

$lang->setDebug($debug);

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18337
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: 2.5.4:Error when using Discover->Install to install temp

Postby infograf768 » Fri May 11, 2012 12:48 pm

@Wyrix

This code is there when someone discovers a template while in debug lang mode.
In this case the default name of the template is saved with **nameoftemplate**

Issue now solved by patch.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Return to “Joomla! 2.5 Bug Reporting”

Who is online

Users browsing this forum: No registered users and 2 guests