News:

Looking for documentation? Take a look on our wiki

Main Menu

I get an error message when I click on "on featured" in the list view.

Started by Rikard, October 31, 2017, 08:15:41 AM

Previous topic - Next topic

Rikard

Hi
When I try to put a product on featured or remove it from featured I get the following message: 
Too few arguments to function VmController::toggle(), 0 passed in /usr/share/nginx/html/www/libraries/src/MVC/Controller/BaseController.php on line 710 and at least 1 expected

If I open a product and click on "featured" it works as expected. It is however very handy to put stuff on featured from list view so I wonder if there is a way for me to make it work.

My specifics:
VM: 3.2.4
Joomla: 3.8.1
PHP: 7.1.10-1

Milbo

Known php 7.1 error, which I did not understand yet. Please use php 7.0. Or maybe it works with the last php7.1. I think this is the first time that I encounter a php bug myself. There is no reason that it works from php 5.3 -php7.0, but not on php7.1
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

In file YOURSITE/administrator/components/com_virtuemart/helpers/vmcontroller.php
class VmController extends JControllerLegacy{
public function toggle($field,$val=null){
argument $field have no default value ?
Try
public function toggle($field=null,$val=null){
I had to change some code for PHP7+ on my extensions too because PHP warnings or error, but accepted in php 5.6

Rikard

Hi
Thank you all for your assistance. I tried the below code change and it works for me.

Quote from: Studio 42 on November 03, 2017, 03:32:42 AM
In file YOURSITE/administrator/components/com_virtuemart/helpers/vmcontroller.php
class VmController extends JControllerLegacy{
public function toggle($field,$val=null){
argument $field have no default value ?
Try
public function toggle($field=null,$val=null){
I had to change some code for PHP7+ on my extensions too because PHP warnings or error, but accepted in php 5.6