November Happy Hour will be moved to Thursday December 5th.

Page not found causes subscription job to fail

Vote:
 

Hi all,

I have a problem with the subscription job failing with this message: Exception has been thrown by the target of an invocation. [Page 2215 was not found] .

I found a post which describes that changes to the getPage method for the version of episerver we're running (5.2 R2) causes the subscription job to throw a pagenotfoundexception if a page that a user subscribe to has been deleted. Ref here: http://litemedia.info/Tags/subscription Sound suspiciously like the problem we're having. But, the fix in the post is something you should do to _prevent_ the problem from occuring, what can we do to remove the reference to this page from the subscription job? Anyone?  

#52617
Aug 05, 2011 13:59
Vote:
 

Hi Cecilie,

 

The main problem with subscription job is when the user subscribes to a page this information is saved into the users profile.So if the editor deletes the subscribed page then the information is not removed from the profiles who have subscribed to the page. One thing that can be done is to write a eventhandler to handle the event whenever the page is deleted..... DataFactory.Instance.Delete +=new PageEventHandler(Instance_DeletePage);

This you can define in the Application_Start event of global.ascx.cs file and also the event method Instance_DeletePage. In this method you can write a logic to remove all subscribed instances of the page from the profiles by unsubscribing the page for all the profiles.

#52638
Aug 08, 2011 9:21
Vote:
 

Thanks a lot for the tip! This means we can loop the profiles then, and remove the references to the deleted page(s) as a short time fix, and implement an eventhandler to deal with it in the long run. Thanks again :)

#52640
Aug 08, 2011 9:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.