Front End to edit items

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
User avatar
magallo
Forum Members
Forum Members
Posts: 105
Joined: Thu Mar 24, 2011 12:37 am

Front End to edit items

Post 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
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1921
Joined: Mon Jan 29, 2007 4:47 pm

Re: Front End to edit items

Post 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.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
magallo
Forum Members
Forum Members
Posts: 105
Joined: Thu Mar 24, 2011 12:37 am

Re: Front End to edit items

Post 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,.
Locked

Return to “Developers Discussion”