API Questions on Kentico API.
Version 5.x > API > Update BlogPostBody but change is not visible View modes: 
User avatar
Member
Member
Comet Halley - 11/16/2011 3:58:26 PM
   
Update BlogPostBody but change is not visible
Hi,

Using v5.5R2. I use API to create a BlogPost. It is displayed OK. Next, there is a change in the BlogPostBody, my code detects the change and update like this:

if (string.Compare(ValidationHelper.GetString(myBlogPost.GetValue("BlogPostBody"), ""), newBodyContent, true) != 0)
{
myBlogPost.SetValue("BlogPostBody", newBodyContent);
}

CMS.WorkflowEngine.DocumentHelper.UpdateDocument(myBlogPost, kenTree);

//Set Workflow steps from Edit to Publish
//using WorkflowManager to MoveToNextStep() from step "Edit" to "published"
.etc.

Sorry I skip the portion of code related to Workflow step settings (It follows the code found in Kentico API doc: API programming and Kentico CMS internals > Managing documents with workflow / A complete example)

QUESTION:
The blog post is still displayed with the previous BlogPostBody. When querying the dbo.CONTENT_BlogPost table, I see that the logPostBody column still contains the previous value.

However, if I use the API to Get the BlogPost by DocumentID. myBlogPost.GetValue("BlogPostBody") shows the new value which were updated previously.

What is the reason the new BlogPostbody is not displayed in Live site and where is the new BlogPostBody value stored in the Database? (table name & Key to get to it).

Thanks very much for any help.

User avatar
Member
Member
Comet Halley - 11/18/2011 6:31:04 PM
   
RE:Update BlogPostBody but change is not visible
Hi,

Attempt to answer, can Kentico API team confirm?

The new content is not visible because we use Workflow. As API documentation recommended, the documente must be checked out for Edit and Checked In after Update. Doing so the new content of the Blog Post is now visible. Sorry for the confusion.

As for where the pending data is located in the database, I think it is in CMS_VersionHistory.NodeXML.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 11/18/2011 9:39:01 PM
   
RE:Update BlogPostBody but change is not visible
Hi,


yes, if the new content is not in the document type table, it means that the content was not published.

The location in the database is correct.


Best regards,
Helena Grulichova