I'm working on code from the Blog4Umbraco project, this specific code creates a year/month/day folder on the beforePublish event. This works perfectly on a normal publish, but gives an "object reference ..." error on a publish at.
The value of sender.Parent.Id is correct, so you would think retreiving the node would not be a problem.
Basically, the datefolders are then created when the document is initially saved. Then, the Publish At functionality works properly. Please note that the changeset I used was from Blog4Umbraco 2.0.26 with the datefolder patch (42029).
Publish at before publish event causes Object reference not set to instance ...
Hi Peter
What is it that you're exactly trying to achieve when the event occurs?
I guess you're probably missing a check or something. But if you could please ellaborate a bit more it would be easier to help you out.
/Jan
Hey,
I'm working on code from the Blog4Umbraco project, this specific code creates a year/month/day folder on the beforePublish event. This works perfectly on a normal publish, but gives an "object reference ..." error on a publish at.
The value of sender.Parent.Id is correct, so you would think retreiving the node would not be a problem.
Here you can find the code:
http://blog4umbraco.codeplex.com/SourceControl/changeset/view/61225#983069
This line causes the error:
Grtz,
Peter
Hi Peter,
I've had the same issue. I've gotten around it by doing the date folder stuff AfterSave rather than BeforePublish (BlogDateFolder.cs).
So:
becomes:
and for the method:
Basically, the datefolders are then created when the document is initially saved. Then, the Publish At functionality works properly. Please note that the changeset I used was from Blog4Umbraco 2.0.26 with the datefolder patch (42029).
Ben
is working on a reply...