3093 Posts in 875 Topics by 654 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 230 Views |
-
onBeforeDelete issues SS3

21 December 2012 at 3:17am
I have a Page Type that automoatically creates a folder to save any images loaded to it. I've set up an onBeforeDelete to delete the folder if the page is deleted, however it throws an excpetion that I'm trying to delete an an Object without an ID. I'm sure its in the onBeforeDelete becaise if I remove it the page deletes fine.
function onBeforeDelete() {
if($this->FolderID != 0){
$folder = $this->Folder();
if($folder) {
$folder->delete();
}
}
parent::onBeforeDelete();
}Any ideas?
-
Re: onBeforeDelete issues SS3

18 January 2013 at 5:19am
Bump! Still haven't figured this out. the $folder->delete() throws an error that i'm trying to delete a dataobject without an ID
-
Re: onBeforeDelete issues SS3

18 January 2013 at 5:45am
After some digging I've realized onBeforeWrite fires on Unpublish, so the Dataobejct is deleted then and not when the page is deleted
| 230 Views | ||
|
Page:
1
|
Go to Top |

