VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Coding Central => Topic started by: Martyn Falkous on December 05, 2019, 11:05:06 am

Title: Parse error: syntax error
Post by: Martyn Falkous on December 05, 2019, 11:05:06 am
New Virtuemart installation, in administrator and front end we are getting the following error:

Parse error: syntax error, unexpected 'and' (T_LOGICAL_AND), expecting ')' in /home2/xxxxxxxx/public_html/administrator/components/com_virtuemart/models/user.php on line 934

Line 934 reads:

   (    (empty($data['virtuemart_vendor_id'] and empty($data['user_is_vendor']))) or

Any ideas please?
Title: Re: Parse error: syntax error
Post by: GJC Web Design on December 05, 2019, 11:13:51 am
shouldn't it be

      if(!empty($data['virtuemart_vendor_user_id']) and is_array($data['virtuemart_vendor_user_id']) or ($data['virtuemart_vendor_user_id']>1) and
                     (    (empty($data['virtuemart_vendor_id']) and empty($data['user_is_vendor'])) or
                        (!empty($data['virtuemart_vendor_id']) and $data['virtuemart_vendor_id']!=$data['virtuemart_vendor_user_id']) ) ){

?

closing )  on the first empty and removed from the end of the statement?
Title: Re: Parse error: syntax error
Post by: Martyn Falkous on December 05, 2019, 11:23:31 am
Hi GJC

Thank you so much, no idea how it was not corrupt but working now :)

Thanks Again!
Title: Re: Parse error: syntax error
Post by: Milbo on December 05, 2019, 12:06:07 pm
Really strange, I wonder that I got no error, which php versoin do you use?
Title: Re: Parse error: syntax error
Post by: GJC Web Design on December 05, 2019, 12:12:11 pm
could u explain what function you were trying when u saw the error?
The syntax was wrong but we are having trouble recreating the error..
Title: Re: Parse error: syntax error
Post by: Zilvermeeuw on January 09, 2020, 06:31:00 am
I got the same error, and GJC gives the solution.
I can reproduce the error with the following steps:
Now virtuemart/administrator gives the error as mentioned by TS. And the solution of GJC solves it.
Title: Re: Parse error: syntax error
Post by: disday on January 13, 2020, 18:51:45 pm
Good day! I just updated VM from 3.4 to 3.6 and got same error on attempt to open http://****/administrator/index.php?option=com_virtuemart
Code: [Select]
PHP Parse error:  syntax error, unexpected 'and' (T_LOGICAL_AND), expecting ')' in ******/administrator/components/com_virtuemart/models/user.php on line 934Corrected parentheses as GJC Web Design advised. VM Control Panel became avaliable but if I tried enter to Orders server returned HTTP 500 again with
Code: [Select]
PHP Parse error:  syntax error, unexpected 'and' (T_LOGICAL_AND), expecting ')' in ***/administrator/components/com_virtuemart/models/orders.php on line 607,I corrected Line 607 same way and it works
Code: [Select]
if(!empty($itemTaxes['VatTax']) and count($itemTaxes['VatTax'])==1){Maybe it helps you.
Title: Re: Parse error: syntax error
Post by: Milbo on February 06, 2020, 20:57:14 pm
vm3.6x is not enough, please tell use the subversion. The whole thing should be fixed in vm3.6.10
Title: Re: Parse error: syntax error
Post by: disday on February 07, 2020, 10:19:37 am
vm3.6x is not enough, please tell use the subversion. The whole thing should be fixed in vm3.6.10
Version is VirtueMart 3.6.10 10211

And there is one more issue with this update described here https://forum.virtuemart.net/index.php?topic=144213.0
Maybe you interesting in check it. ;)