? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
15 Mar 2015

Issue

When you edit the template (not the template style!) in the template manager, you may see a warning "Extension record not found in database.". This doesn't occur for core templates. It only happens for templates where the name specified in the XML file doesn't match the (sanitised) folder that will be created.
You can use my template from http://www.bakual.net/download/less-allrounder/less-allrounder-2-1-0.html to verify that. The template name is "{LESS} Allrounder" which will be sanitised to "lessallrounder". (I know the template is crap, don't judge me on that g)

Explanation

In the #__extension table, we store both a name and an element for the template. The name is stored as is defined in the XML manifest file, and the element is the sanitised name which will be used for the folder and to reference the template in the #__template_styles table (and probably many more places).
Now we look at the TemplatesModelTemplate->getPreview() method and see that the query there looks for the name of the template, when it instead should look for the element.
This is why the query will fail and produce this warning.

Test Instructions

  1. Install the "{LESS} Allrounder" template from http://www.bakual.net/download/less-allrounder/less-allrounder-2-1-0.html
  2. Go to the Template Manager -> Templates view and click there on the link to edit the files on this template.
  3. Verify you see a warning "Extension record not found in database.". If you have error reporting enabled and set on "maximum" or "development" you will also see two notices like "Trying to get property of non-object in ...\administrator\components\com_templates\views\template\view.html.php on line 224" and "Trying to get property of non-object in ...\administrator\components\com_templates\views\template\view.html.php on line 226". Clicking the "Template Preview" button will load the page with the default template, and not with the one your editing.
  4. Apply this PR and reload the page
  5. There should be no warning message anymore and the button should properly work.
avatar Bakual Bakual - open - 15 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2015
Labels Added: ?
avatar waader
waader - comment - 15 Mar 2015

@test works as described, thanks!

avatar waader waader - test_item - 15 Mar 2015 - Tested successfully
avatar exo58 exo58 - test_item - 15 Mar 2015 - Tested successfully
avatar exo58
exo58 - comment - 15 Mar 2015

fix works as described.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6450.
avatar MAT978
MAT978 - comment - 15 Mar 2015

@test

able to reproduce then #6450 works as described with no warning nor notices.

Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6450.
avatar MAT978 MAT978 - test_item - 15 Mar 2015 - Tested successfully
avatar wilsonge wilsonge - change - 16 Mar 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-03-16 15:03:36
avatar wilsonge wilsonge - close - 16 Mar 2015
avatar wilsonge wilsonge - reference | - 16 Mar 15
avatar wilsonge wilsonge - merge - 16 Mar 2015
avatar wilsonge wilsonge - close - 16 Mar 2015
avatar wilsonge wilsonge - change - 16 Mar 2015
Milestone Added:
avatar Bakual Bakual - head_ref_deleted - 16 Mar 2015

Add a Comment

Login with GitHub to post a comment