1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / GetActualCurrentNode() Null When Re-Indexing

GetActualCurrentNode() Null When Re-Indexing

4 posts, 0 answered
  1. Merge
    Merge avatar
    4 posts
    Registered:
    30 Jul 2012
    07 Jul 2011
    Link to this post
    In our pages, we have several UserControls that we've created that call SiteMapBase.GetActualCurrentNode() when rendering. They use the node path to identify and pull content items from a custom module we've created,  and then display some property information from those content items (mostly name/address information). This code works just fine both front-end and back-end. However, when we re-index the search index we've set up, GetActualCurrentNode() always returns null whenever the spider tries to load the control.

    We need the content generated by these controls to be rendered and included when the pages are indexed. Is there a way around this?

    Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    07 Jul 2011
    Link to this post
    Hello Riley,

    The only way is to escape the code that uses GetActualCurrentNode, because in index mode it is null. With the current implementation if the index fails its stops, so all other pages won't be indexed.

    if(page.Items["IsInIndexMode"] == null)
    {
    }

    We are making changes in the API for Q2 which will catch the error internally, log it and the index keep working.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Merge
    Merge avatar
    4 posts
    Registered:
    30 Jul 2012
    07 Jul 2011
    Link to this post
    Thanks for the reply.

    We've dealt with the error by coding around it, as you've said. Still, this means that no content rendered by controls that depend upon GetActualCurrentNode() can ever be indexed by the search. It would seem that this is could be a pretty serious drawback for developers creating custom modules and controls that tie pages to custom content together.

    For example, we have a custom module that stores restaurant information (name, location, hours of operation, contact info, etc), and have pages in the site structure for each. Usercontrols figure out which page node we're looking at based on GetActualCurrentNode(), load the correct restaurant from our module based on the node path, and render all that info from the module directly to the page. Unfortunately, the limitation you've described with GetActualCurrentNode() means that none of that info will ever be rendered for the search crawler to index it.

    We'll keep looking for workarounds. Any chance you can get GetActualCurrentNode() working in index mode in a future release?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Jul 2011
    Link to this post
    Hi Riley,

    The crawler gets all HTML from the page, so there should not be not indexed data. If you have exposed a pages on which your custom module data is stored then, it will be indexed. After refactoring the API for Q2 you will be able to crate a custom pipe for your modules, so you will be able to control what the index will include.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered