Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Slade 48 posts 109 karma points
    Oct 17, 2014 @ 18:52
    Mark Slade
    0

    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

  • Charles Afford 1163 posts 1709 karma points
    Oct 19, 2014 @ 15:47
    Charles Afford
    0

    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 :)

Please Sign in or register to post replies

Write your reply to:

Draft