VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: jdraper on December 11, 2018, 00:22:32 AM

Title: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: jdraper on December 11, 2018, 00:22:32 AM
virtuemart 3.4.2
php 5.6.38
joomla 3.9.1

Changed to PHP 7.2

show cart gives me:

#0 [] operator not supported for strings

Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: GJC Web Design on December 11, 2018, 09:42:46 AM
You need to find where it is by debug and logging and declare the far as an array
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: jdraper on December 12, 2018, 01:44:44 AM
I found the likely issue here:

Call stack      
#   Function   Location
1   ()   JROOT/plugins/vmpayment/elavon/elavon.php:251

Of course this is my elavon payment method.

I look at line 251 and it is nothing.

What am I looking for when you say "declare the far as an array"?

Jerry
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: Jörgen on December 12, 2018, 06:11:30 AM
I think he means the var
Jörgen @ Kreativ Fotografi
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: GJC Web Design on December 12, 2018, 10:17:13 AM
yes -- var -- touchscreens..  ::)

look for something like

$foo = $bah[];

then look at the code above and see if the $bah has been declared as an array

if not before it put $bah = array();
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: jdraper on December 13, 2018, 00:23:24 AM
at stmt 251 I have:

            $htmla[] = $html;
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: Jörgen on December 13, 2018, 05:44:08 AM
$htmla = array();
Jörgen @ Kreativ Fotografi
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: GJC Web Design on December 13, 2018, 09:21:04 AM
Before that line
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: Jörgen on December 13, 2018, 11:11:26 AM
$htmla = array();
$htmla[] = $html;


Jörgen @ Kreativ Fotografi
Title: Re: upg php 5.6.38 to php 7.2: show cart #0 [] operator not supported for strings
Post by: jdraper on December 18, 2018, 22:34:01 PM
Thanks,  that resolved my issue.  I am now on pHp 7.2.

Yeah!

Jerry