I've created a new ApplicationEventHandler to handle the publish event as I want to do a number of things when someone publishes new content. The first of these is to create an manifest file for offline content and the other this is to update a "system" field on the homepage, but this is where i'm having the problem.
in the ContentService.Published handler I want to count the number of pages (iContent) that are of a certain alias and then put this number into a field on the homepage.
I get the count no problem. But when I enter the number into the field and try and publish we end up in an infinate loop with the function calling itself.
Any ideas how I can overcome this?
Ive tried the ContentService.SaveAndPublishWithStatus(node, 0, false) the false should call the function without raising any events, but it does!!
V6 ContentServicePublished event
Hi All,
I've created a new ApplicationEventHandler to handle the publish event as I want to do a number of things when someone publishes new content. The first of these is to create an manifest file for offline content and the other this is to update a "system" field on the homepage, but this is where i'm having the problem.
in the ContentService.Published handler I want to count the number of pages (iContent) that are of a certain alias and then put this number into a field on the homepage.
I get the count no problem. But when I enter the number into the field and try and publish we end up in an infinate loop with the function calling itself.
Any ideas how I can overcome this?
Ive tried the ContentService.SaveAndPublishWithStatus(node, 0, false) the false should call the function without raising any events, but it does!!
Thanks in advance
Mark
Yea i have had this before as well. Its because the Published event then get fired again when you save and publish.
Have you tried ContentService.SaveAndPublish(node, false). What does that do?
If that does not work i would raise it as a bug or take a look at the source :).
Charlie :)
is working on a reply...