VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Greg on May 23, 2017, 11:26:14 AM

Title: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Greg on May 23, 2017, 11:26:14 AM
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)
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: jenkinhill on May 23, 2017, 12:09:00 PM
Quote from: Greg on May 23, 2017, 11:26:14 AM
(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
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Milbo on May 24, 2017, 07:24:47 AM
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?
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Jörgen on May 24, 2017, 08:36:16 AM
Hello Milbo

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

A null parameter value results in:
QuoteUncaught 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
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: xdoktor on June 28, 2017, 20:08:23 PM
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
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: jenkinhill on June 28, 2017, 23:31:05 PM
Can you test with Virtuemart.3.2.3.9579  on PHP7.1+ - http://dev.virtuemart.net/attachments/download/1083/com_virtuemart.3.2.3_extract_first.9579.zip
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: xdoktor on June 29, 2017, 11:40:18 AM
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.
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: serge-web54 on February 28, 2018, 14:09:57 PM
I confirm that I had the same issue and have solved it by downgrade to php 7.0
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Studio 42 on February 28, 2018, 14:58:06 PM
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.
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Milbo on March 01, 2018, 09:50:20 AM
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.
Title: Re: SOLVED - Too few arguments to function VmController::toggle(), 0 passed in /var
Post by: Milbo on March 01, 2018, 10:10:06 AM
Here, please test http://dev.virtuemart.net/attachments/download/1113/com_virtuemart.3.2.13.9772_extract_first.zip