Copied to clipboard

Flag this post as spam?

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


  • Manish Ramanan 8 posts 28 karma points
    Apr 16, 2013 @ 15:29
    Manish Ramanan
    0

    Umbraco 6.1 Beta Gathering Node Data event not working

    Hello all,

    I was trying out umbraco 6.1 beta , updated my original site from 4.11.0 to 6.1 beta.

    Originally it has one class in APP_CODE which is implementing GatheringNodeData event, after upgrade its not triggerring that event.

    In the event I was adding a column to the Index , now I'm unable to see that using luke.

    Has anyone faced this issue.

    The class is inheriting from : ApplicationBase

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 16, 2013 @ 17:14
    Ismail Mayat
    0

    Manish,

    I am using 6.0 and i had similar issue however I updated my class to inherit from

    IApplicationStartupHandler

    That caused it all to start working again.

    Regards

     

    Ismail

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Apr 17, 2013 @ 10:51
    Tim
    0

    Ismail is right, ApplicationBase is deprecated, you're meant to use the ApplicationStartUpHandler instead for v6+ (you can also use it in 4.11 as well if you want)

  • Manish Ramanan 8 posts 28 karma points
    Apr 17, 2013 @ 14:18
    Manish Ramanan
    0

    I changed it but still its not firing 

    Below is the code I used 

    public class IndexLanguageField : IApplicationStartupHandler

    {

        public IndexLanguageField()

        {

            ExamineManager.Instance.IndexProviderCollection["MyDataIndexer"].GatheringNodeData += this.IndexLocations_GatheringNodeData;

        }

    private void IndexLocations_GatheringNodeData(object sender, IndexingNodeDataEventArgs e)
        {
            if (e.IndexType == IndexTypes.Content)
            {
                Node indexingNode = uQuery.GetNode(e.NodeId);
                if (indexingNode.Path.Contains("1454"))
                {
                    e.Fields.Add("language", "french");
                }
                else {
                    e.Fields.Add("language", "english");
                }
            }
        }
    }
  • Manish Ramanan 8 posts 28 karma points
    Apr 17, 2013 @ 15:48
    Manish Ramanan
    0

    Thanks for the replies Ismail and Tim its working now.

Please Sign in or register to post replies

Write your reply to:

Draft