News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Parse error: syntax error

Started by Martyn Falkous, December 05, 2019, 11:05:06 AM

Previous topic - Next topic

Martyn Falkous

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?

GJC Web Design

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?
GJC Web Design
VirtueMart and Joomla Developers - php developers [url="https://www.gjcwebdesign.com"]https://www.gjcwebdesign.com[/url]
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
[url="https://extensions.joomla.org/profile/profile/details/67210"]https://extensions.joomla.org/profile/profile/details/67210[/url]
Contact for any VirtueMart or Joomla development & customisation

Martyn Falkous

Hi GJC

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

Thanks Again!

Milbo

Really strange, I wonder that I got no error, which php versoin do you use?
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

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..
GJC Web Design
VirtueMart and Joomla Developers - php developers [url="https://www.gjcwebdesign.com"]https://www.gjcwebdesign.com[/url]
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
[url="https://extensions.joomla.org/profile/profile/details/67210"]https://extensions.joomla.org/profile/profile/details/67210[/url]
Contact for any VirtueMart or Joomla development & customisation

Zilvermeeuw

I got the same error, and GJC gives the solution.
I can reproduce the error with the following steps:

  • New VM with Centos7, minimal install, update, install LAMP
  • Copy (with php kickstart *.jpa) an webshop with joomla 3.4.8 and virtuemart 3.0.12
  • Update joomla to 3.6.5, update virtuemart (version I cannot access at this time, but later I can)
Now virtuemart/administrator gives the error as mentioned by TS. And the solution of GJC solves it.
If I never done it, I think I am able to do it.

disday

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
PHP Parse error:  syntax error, unexpected 'and' (T_LOGICAL_AND), expecting ')' in ******/administrator/components/com_virtuemart/models/user.php on line 934
Corrected parentheses as GJC Web Design advised. VM Control Panel became avaliable but if I tried enter to Orders server returned HTTP 500 again with
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
if(!empty($itemTaxes['VatTax']) and count($itemTaxes['VatTax'])==1){
Maybe it helps you.

Milbo

vm3.6x is not enough, please tell use the subversion. The whole thing should be fixed in vm3.6.10
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

disday

Quote from: 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
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. ;)