sakgiok / codwfeeplus

A prestashop module for implementing Cash On Delivery with a fee with a lot of options,
GNU General Public License v3.0
59 stars 20 forks source link

Undefined index id in switch input of setting form #18

Open atmansviluppo opened 2 years ago

atmansviluppo commented 2 years ago

I updated prestashop to version 1.7.8.7 in my local environment and found the error bellow when opening the module setting page:

image

This happens because the values array of switch input does not have the key id:

https://github.com/sakgiok/codwfeeplus/blob/bf1b1068e161ccfe7e96166f1c6de635eedd6556/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php#L1287-L1299

It should be:

'values' => array( 
         array( 
             'id' => 'active_on', 
             'value' => 1, 
         ), 
         array( 
             'id' => 'active_off', 
             'value' => 0, 
         ), 

All switch input in the form need to be fixed.

Thank you!

Luifer-dnk commented 11 months ago

I updated prestashop to version 1.7.8.7 in my local environment and found the error bellow when opening the module setting page:

image

This happens because the values array of switch input does not have the key id:

https://github.com/sakgiok/codwfeeplus/blob/bf1b1068e161ccfe7e96166f1c6de635eedd6556/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php#L1287-L1299

It should be:

'values' => array( 
         array( 
             'id' => 'active_on', 
             'value' => 1, 
         ), 
         array( 
             'id' => 'active_off', 
             'value' => 0, 
         ), 

All switch input in the form need to be fixed.

Thank you!

FIxed, many thanks !!!

But have a new bug on file /modules/codwfeeplus/views/templates/admin/_configure/helpers/form/form.tpl.

Now put a new issue.