VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: teobgeno on April 10, 2012, 05:29:31 AM

Title: vmError: renderMail get Template failed vm 2.0.4
Post by: teobgeno on April 10, 2012, 05:29:31 AM
I get an error when i change order status at backened   joomla 1.5.26 Vm 2.0.4

vmError: renderMail get Template failed: Table 'photo.jos_template_styles' doesn't exist SQL=SELECT `template` FROM `jos_template_styles` WHERE `client_id`="0" AND `home`="1"

I know this table does not exists in joomla 1.5.x versions and is probably at newer versions of joomla.
Is there a setting to disable this procedure or it is source code case.
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: Studio 42 on April 10, 2012, 15:41:16 PM
in normal case j1.5 use
'SELECT `template` FROM `#__templates_menu`

and we test the joomla version, it's very strange , you have this query in joomla 1.5.

I have updated to the new method to compare joomla version, but it's only in the SVN files for now.
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: teobgeno on April 10, 2012, 16:16:39 PM
Can you give me a guide where this  check of joomla version exists in the source code ?
Thank you
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: Studio 42 on April 10, 2012, 17:00:46 PM
try to change in ROOT\administrator\components\com_virtuemart\models\config.php
line 55

if(version_compare(JVERSION,'1.6.0','ge')) {

to

if (JVM_VERSION === 2) {
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: teobgeno on April 10, 2012, 18:18:01 PM
Thank you for your reply

The administrator/components/com_virtuemart/models/config.php is ok the error was at

com_virtuemart/helpers/shopfunctionf/shopfunctionsf.php  -> function renderMail (line 186)

if(JVM_VERSION == 2){
   $q = 'SELECT `template` FROM `#__template_styles` WHERE `client_id`="0" AND `home`="1"';
} else {
  $q = 'SELECT `template` FROM `#__template_styles` WHERE `client_id`="0" AND `home`="1"';
}


The if statement functionality is correct  but the query is the same for both versions. This must be modified as

if(JVM_VERSION == 2){
   $q = 'SELECT `template` FROM `#__template_styles` WHERE `client_id`="0" AND `home`="1"';
} else {
  $q = 'SELECT `template` FROM `#__templates_menu` WHERE `client_id` ="0" ';
}

Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: Thomas Kuschel on April 12, 2012, 15:24:37 PM
Thank you teobgeno!
On my Joomla 1.5, it works now after changing the com_virtuemart/helpers/shopfunctionf/shopfunctionsf.php
Thomas
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: Milbo on April 12, 2012, 15:31:21 PM
Imho the fix is too dirty, please look here
http://forum.virtuemart.net/index.php?topic=100927.0
Title: Re: vmError: renderMail get Template failed vm 2.0.4
Post by: teobgeno on April 12, 2012, 15:34:22 PM
glad i could help thoma kai apo oti katalaba Elina kiolas :)