10929 Posts in 2613 Topics by 1809 members
|Go to End|
21 July 2010 at 4:36pm
I have added the Poll Module to a website and need to make sure that only one poll is active at a time. So I added the onBeforeWrite on the Poll DataObject, thinking that it may do the trick. Unfortuently that did not work. The problem is that it also gets called when the user saves a poll question in the front-end. So everytime someone answers the Poll question it gets de-acativated. I guess that I could do some checks to see if the action is recieved from the CMS or the Frontend and then do some conditional check in the onBeforeWrite method (quick and dirty way). However, I would think it would be much better to extend the Controller class for this purpose. I would assume that it would be fairly common to extend the doSave in the ModelAdmin_RecordController. Does anyone have some sample code for extending the ModelAdmin_RecordController or point me in the right direction. Thanks in advance.
|Go to Top|