Page 1 of 1
Front End to edit items
Posted: Sat May 06, 2017 1:01 am
by magallo
Hi Guys, i'm kind of stuck.
I created a module following the Holidays tutorial but i'm trying to have both admins and FEU edit the items.
Everything works well in the admin section but FEU submission returns errors.
It looks like the form is submitting elsewhere and can't find the parameters.
The url goes back to the original url (without variables) and here is the following error:
Warning: Parameter starting_price is not known by module BTG_AdmissionConsulting dropped in /home/xxxxx..../lib/classes/class.CMSModule.php on line 653
Thanks for the help
Re: Front End to edit items
Posted: Sat May 06, 2017 11:14 am
by Jo Morg
magallo wrote:It looks like the form is submitting elsewhere and can't find the parameters.
The url goes back to the original url (without variables) and here is the following error:
Warning: Parameter starting_price is not known by module BTG_AdmissionConsulting dropped in /home/xxxxx..../lib/classes/class.CMSModule.php on line 653
Check:
http://www.cmsmadesimple.org/APIDOC2_0/ ... odule.html
For security reasons there is a mechanism implemented in the CMSModule API to prevent unknown parameters to be accidentally handled by the modules:
http://www.cmsmadesimple.org/APIDOC2_0/ ... nownParams
Code: Select all
RestrictUnknownParams(bool $flag = true)
This call makes sure the module drops any parameter not registered by
Code: Select all
SetParameterType(string $param, \define $type)
See:
http://www.cmsmadesimple.org/APIDOC2_0/ ... ameterType
If you look at the method
InitializeFrontend() of the module you'll probably see some parameters already initialized and the
$this->RestrictUnknownParams(); already called...
So you'll have to use
$this->SetParameterType(...) for each frontend parameter you want your module to handle.
Re: Front End to edit items
Posted: Tue May 09, 2017 3:30 am
by magallo
Jo Morg wrote:
So you'll have to use $this->SetParameterType(...) for each frontend parameter you want your module to handle.
thanks @Jo Morg, that's exactly what I needed. I manually added all the parameters posted from the form including submit and cancel.
I also implemented the pretty url settings as described in the guide.
I'm now facing some Upload file challenges, but will dig the form for some more info as I think I saw it somewhere.
Thanks again,.