I am seeing an issue in the Content Management side. When I publish a Page, I am seeing the RenderedContent
in the JSON output for some Component Templates. When I republish the Page again, I am not seeing the RenderedContent
output in the JSON. But this is happening intermittently.
Upon comparing the created JSONs for different languages, we are seeing the below line for French version whereas in English it does not exist.
"RenderedContent": "{\"Component\":{\"LastPublishedDate\":......}
Does anyone have an idea on how to fix this issue?
Additional details:
- This issue(JSON content of the associated pages with the published linked component has rendered content tag which prevents the DXA framework from recognizing the content and hence displaying empty content on the page) occurs intermittently when the content publishing team takes linked components and associated pages through the publishing workflow.
- When the page is republished or previewed on CMS the JSON content is showing properly.
- In response to Shiva's comment, we could correlate the issue with the dd4t JSON serialization code. Is it possible the below code is related to the issue?
<< try { // we cannot be sure the component template uses the same serializer service as the page template // so we will call a factory which can detect the correct service based on the content ISerializerService serializerService = SerializerServiceFactory.FindSerializerServiceForContent(dd4tData); cp = serializerService.Deserialize(dd4tData);
// inital renderedContent could contain si4t search data. we need to preserve the search data.
// lets retrieve the si4t search data if that's the case and added to the renderedContent property
cp.RenderedContent = Si4tUtils.RetrieveSearchData(renderedContent);
}
catch (Exception e)
{
log.Error("exception while deserializing into CP", e);
// the component presentation could not be deserialized, this probably not a Dynamic Delivery template
// just store the output as 'RenderedContent' on the CP
cp.RenderedContent = renderedContent;
// because the CT was not a DD4T CT, we will generate the DD4T XML code here
cp.Component = manager.BuildComponent(tcmComponentPresentation.Component);
}
Further findings: Below are further findings:
- The issue is reported both in English and French pages.
- The templates are not localized and we are leveraging the framework
TBBs
TBBs in Page Template:
Render Page Content
Default Page Template Finish Actions
TBBs in Component Template:
Render Component Content
Default Component Template Finish Actions - The issue is intermittent only in production environment from Dec 3rd week and not able to replicate in lower environment
- The issue get fixed after republishing the page again to that specific target
- When we analyze the page record in Broker DB we noticed that the JSON is not de-serialized for some of the fields and the field content is added to "RenderedContent" attribute