VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: welrachid on May 01, 2017, 11:28:13 AM

Title: VM invoice gives warnings but no warnings on frontend
Post by: welrachid on May 01, 2017, 11:28:13 AM
Joomla set not to show warnings, but when i click invoice i get a lot of warnings.
any ideas how to make that disabled aswell?


Warning: Illegal string offset 'relative' in libraries/cms/html/html.php on line 620
Warning: Illegal string offset 'pathOnly' in libraries/cms/html/html.php on line 621
Warning: Illegal string offset 'detectBrowser' in libraries/cms/html/html.php on line 622
Warning: Illegal string offset 'detectDebug' in libraries/cms/html/html.php on line 623
Warning: Illegal string offset 'relative' in libraries/cms/html/html.php on line 626
Warning: Illegal string offset 'detectBrowser' in libraries/cms/html/html.php on line 626
Warning: Illegal string offset 'detectDebug' in libraries/cms/html/html.php on line 626
Warning: Illegal string offset 'pathOnly' in libraries/cms/html/html.php on line 629


J!3.7
VM3.2.1
PHP5.6.24
Title: Re: VM invoice gives warnings but no warnings on frontend
Post by: welrachid on May 02, 2017, 22:35:30 PM
Okay.. very weird.
Somehow these errors are caused by the "2nd" parameter to the jhtml::stylesheet method which is getting a STRING when expected an array
I got a
http://example.dk/components/com_virtuemart/assets/css/

where i should have had an array.

I made a core-hack fix, until i know why this is happening..
I've replaced libraries/cms/html/html.php line 617
BEFORE:
}
AFTER:
      }elseif(!is_array($options)){$options = array('relative' => false, 'pathOnly' => false,'detectBrowser' => true, 'detectDebug'=>true);}


Im not sure if its a template-thing or not..
but i've been using vmbeez5 as basis.
Title: Re: VM invoice gives warnings but no warnings on frontend
Post by: Milbo on May 03, 2017, 09:17:19 AM
these come from VM template files that use JHtml::stylesheet ()

e.g. in components\com_virtuemart\views\user\tmpl\edit_address.php  line 23

e.g.  JHtml::stylesheet ('vmpanels.css', JURI::root () . 'components/com_virtuemart/assets/css/');

replace with

vmJsApi::css('vmpanels');
Title: Re: VM invoice gives warnings but no warnings on frontend
Post by: mickey3k on May 23, 2017, 20:25:02 PM
Are there more lines in some files where we have to replace with vmJsApi? I replaced line 23 in edit_address.php but the error messages are still showing.

Only with welrachid's core hack can I get rid of them, but every Joomla Update resets this line.
Title: Re: VM invoice gives warnings but no warnings on frontend
Post by: GJC Web Design on May 23, 2017, 21:18:49 PM
Not in vm3.2.2 but there could easily be in your over rides