Custom Courier Packaged Event being fired by Item Save and Item Publish
Tested with: Umbraco v. 4.11.8, Courier v. 2.7.5.1.90v4 and Courier Nightly v. 2.7.8.16.hotfix.v4 same results:
If I create a .cs code file in my site's app_code directory with the following:
//start of code file using umbraco.BusinessLogic; using Umbraco.Courier.Core; using Umbraco.Courier.ItemProviders;
public class auditCourierLog : ApplicationBase { public auditCourierLog() { DocumentItemProvider.Instance().Packaged += auditCourierLog_Packaged; } void auditCourierLog_Packaged(object sender, ItemEventArgs e) { Log.Add(LogTypes.Custom, -1, "Custom Packaged Event Executed."); } } //end of code file The method "auditCourierLog" should fire during the courier packaged event. Unfortunately, it's firing during the Item Save, and twice during the Item Save and Publish.
To reproduce, create the .cs codefile in app_code directory as above.
Create and save an item.
Make a change to the item, save & publish
Note the log entries are being created without using Courier to package anything.
Check the umbracoLog table, you'll see the log entries after each save and publish event like this:
Custom Courier Packaged Event being fired by Item Save and Item Publish
Tested with: Umbraco v. 4.11.8, Courier v. 2.7.5.1.90v4 and Courier Nightly v. 2.7.8.16.hotfix.v4 same results:
If I create a .cs code file in my site's app_code directory with the following:
//start of code file
using umbraco.BusinessLogic;
using Umbraco.Courier.Core;
using Umbraco.Courier.ItemProviders;
public class auditCourierLog : ApplicationBase
{
public auditCourierLog()
{
DocumentItemProvider.Instance().Packaged += auditCourierLog_Packaged;
}
void auditCourierLog_Packaged(object sender, ItemEventArgs e)
{
Log.Add(LogTypes.Custom, -1, "Custom Packaged Event Executed.");
}
}
//end of code file
The method "auditCourierLog" should fire during the courier packaged event. Unfortunately, it's firing during the Item Save, and twice during the Item Save and Publish.
To reproduce, create the .cs codefile in app_code directory as above.
Create and save an item.
Make a change to the item, save & publish
Note the log entries are being created without using Courier to package anything.
Check the umbracoLog table, you'll see the log entries after each save and publish event like this:
is working on a reply...