Custom module breaking template save

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
Post Reply
densefog
New Member
New Member
Posts: 2
Joined: Mon Oct 22, 2012 8:37 pm

Custom module breaking template save

Post by densefog »

I have a custom module referenced in a template with {cms_module module='mymodule'}. After upgrading to 1.11.2 (from 1.9) when I try to save the template from the template editor it runs the action.default.php page of that module.

I was under the impression that the action.default.php was only invoked when on the site not when saving a template. I believe from walking through the code that smarty is attempting to compile my code. Is this for caching? My modules were made quite a while back. Am I missing a property that would stop this from happening?

Thanks!
Troy
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Custom module breaking template save

Post by Dr.CSS »

You might want to read the What We Broke part of this...

http://forum.cmsmadesimple.org/viewtopi ... =1&t=57370
densefog
New Member
New Member
Posts: 2
Joined: Mon Oct 22, 2012 8:37 pm

Re: Custom module breaking template save

Post by densefog »

Thanks for the reply. I went through the list of possible issues and my modules appear pretty clean.

I decided to compare an existing module to see if I was doing something wrong. I loaded a template with: {cms_module module='Printing'}. This module as well has the action.default.php script processed during the saving of a template. I'm not sure to what benefit but my guess is some form of compilation by smarty for processing later?

My module looks at the current url and loads a 'dealer' based on the url. If a dealer isn't found it redirects the page. Since I'm using the admin url we don't have a dealer and the redirect is physically processed by saving the template and off I go to another page. :)

My guess is this will cause some unforeseen problems in the future.

Troy
Post Reply

Return to “Developers Discussion”