I'm trying to cancel a save event and so I was trying using the Event Handlers.
I tried both BeforePublish and BeforeSave events.
The BeforePublish works as expected (I can cancel it), but the BeforeSave doesn't.
Here is some code I made for testing:
[code]
public class UmbracoEventHandlers : ApplicationBase
{
public UmbracoEventHandlers() {
Document.BeforePublish += new Document.PublishEventHandler(DocumentBeforePublish);
Document.BeforeSave += new Document.SaveEventHandler(DocumentBeforeSave);
}
Both DocumentBeforeSave and DocumentBeforePublish are beeing runned because I put break points to assure that.
Does anyone know what I can be doing wrong in the BeforeSave?
This is a limitation in the current Umbraco architecture (it persists data immedially upon property set) and there's no fix nor a workaround for the Umbraco 4.0.x lifespan (ie at least next six months).
I can accept that something doesn't work and can't be fixed in 4.x owing to the underlying architecture.
I CANNOT accept that this is not documented on the class or in the event declaration, and that I will only find it out after doing a week of work and selling myself down the river along this path. And then only find out from some 4 year old forum post after a load of searching.
This is supposed to be professional software. As such, it behoves you to document its limitations. Otherwise, professional sofware developers are going to be wasting their time, and losing their patience with it.
BeforePublish and BeforeSave Event Handlers
Hi everyone!
I'm trying to cancel a save event and so I was trying using the Event Handlers.
I tried both BeforePublish and BeforeSave events.
The BeforePublish works as expected (I can cancel it), but the BeforeSave doesn't.
Here is some code I made for testing:
[code]
public class UmbracoEventHandlers : ApplicationBase
{
public UmbracoEventHandlers() {
Document.BeforePublish += new Document.PublishEventHandler(DocumentBeforePublish);
Document.BeforeSave += new Document.SaveEventHandler(DocumentBeforeSave);
}
void DocumentBeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e) {
e.Cancel = true;
}
void DocumentBeforePublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e) {
e.Cancel = true;
}
}
[/code]
Both DocumentBeforeSave and DocumentBeforePublish are beeing runned because I put break points to assure that.
Does anyone know what I can be doing wrong in the BeforeSave?
thanks
Pedro
Hi,
See this work item on Codeplex: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=21847
Please vote for it to get if fixed asap!
Regards,
/Dirk
Thanks!
This is terrible... ](*,)
Just Voted !
Is there any workaround?...
This is a limitation in the current Umbraco architecture (it persists data immedially upon property set) and there's no fix nor a workaround for the Umbraco 4.0.x lifespan (ie at least next six months).
This is not good enough.
I can accept that something doesn't work and can't be fixed in 4.x owing to the underlying architecture.
I CANNOT accept that this is not documented on the class or in the event declaration, and that I will only find it out after doing a week of work and selling myself down the river along this path. And then only find out from some 4 year old forum post after a load of searching.
This is supposed to be professional software. As such, it behoves you to document its limitations. Otherwise, professional sofware developers are going to be wasting their time, and losing their patience with it.
is working on a reply...