Incoming RSS to Blog - Set Owner?

Posted by Community Admin on 03-Aug-2018 21:17

Incoming RSS to Blog - Set Owner?

All Replies

Posted by Community Admin on 20-Jan-2012 00:00

I have an incoming RSS feed that publishes to my Sitefinity blog. When my content people review the draft and post it the owner comes back as 'User Not Found'. Is there a way to set the owner?

Posted by Community Admin on 21-Jan-2012 00:00

Hi Mark,

By default the Owner of the blog post should be set to the Owner of the Blog they are created under. If the user who created that particular blog does not exist anymore it is normal for Sitefinity to display 'User Not Found'. One option would be to recreate the blog with an existing user, or try to change the owner programatically like this:

protected void Page_Load(object sender, EventArgs e)
        
            var manager = UserManager.GetManager();
            var newOwner = manager.GetUser("MyUser").Id;
            ChangeBlogAndPostsOwner("MyBlog", newOwner);
        
 
        public void ChangeBlogAndPostsOwner( string blogTitle, Guid ownerId)
        
            var myBlog = App.WorkWith().Blogs().Where(b => b.Title == blogTitle).ForEach(b =>
                
                    b.Owner = ownerId;
                ).SaveAndContinue().Get().SingleOrDefault();
            App.WorkWith().BlogPosts().Where(bp => bp.Parent == myBlog.Id).ForEach(bp =>
                
                    bp.Owner = ownerId;
                ).SaveChanges();
        


Kind regards,
Boyan Barnev
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

This thread is closed