Author Topic: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var  (Read 8462 times)

Greg

  • Beginner
  • *
  • Posts: 19
Hello,
J3.7.1 VM3.2.2

Suddenly I get this error when toggle-ing the Featured Products in the Product List?
Appeared when doing a search in the product list as well.

"Too few arguments to function VmController::toggle(), 0 passed in /var/www/www.lydmuren.dk/www/libraries/legacy/controller/legacy.php on line 709 and at least 1 expected"

Any sugs?


SOLUTION - dont know why but downgrading from PHP 7.1. to 7.0. did the trick. (oh in case you dont know ioncube does not run on php 7.1 yet)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28390
  • Always on vacation
    • Jenkin Hill Internet
(oh in case you dont know ioncube does not run on php 7.1 yet)

Good job that VM does not use it, then. But VM, like many other Joomla extensions, is not yet fully ready for PHP7.1.x
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.8 10748  J3.10.11 PHP 7.4.30

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10466
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I wonder about php7.1, we get strange bugs, which are for me bugs of php7.1. For example, not derivating attributs of a parent class ? Or here, suddenly to few arguments? What does that mean, the param with default value is not anylonger allowed?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3922
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Hello Milbo

Php 7 now handles null items different:
http://php.net/manual/en/migration71.new-features.php

A null parameter value results in:
Quote
Uncaught Error: Too few arguments to function test(), 0 passed in...

This is probably a step on the way for more secure code.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

xdoktor

  • Jr. Member
  • **
  • Posts: 71
Hey Milbo,

was there any progress on this?
as testing in xampp using PHP 7.1.6 and so far when trying to press 'featured' quick icon/button on product list page I get:

"Too few arguments to function VmController::toggle(), 0 passed in C:\xampp\htdocs\site1\libraries\legacy\controller\legacy.php on line 709 and at least 1 expected"

I can still enter the product directly and use check box 'featured' as that still works.

any ideas?

peace

X

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28390
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.8 10748  J3.10.11 PHP 7.4.30

xdoktor

  • Jr. Member
  • **
  • Posts: 71
Will give it a try but I am close to a live launch and may just have to switch back to lower PHP vers. in meantime.
I will post here if VM dev vers works.

serge-web54

  • Jr. Member
  • **
  • Posts: 56
I confirm that I had the same issue and have solved it by downgrade to php 7.0

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4664
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Anout php7.1, you need to have same number of argument in all parent and children class, it's why you have this error certainly.
Adding default values should solve the problem.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10466
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Thank you studio, the problem is solved since a month or so. I am going to upload a test version vm3.2.13, then you can check.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10466
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/