Issue
- Some web contents are not displayed in context when accessed from search results with the "Display selected search result in context" checkbox selected.
- For web contents displayed in an asset publisher, the correct context is the page containing the asset publisher displaying the web content. For many web contents, clicking on them in the search results list leads to the correct context page. However, there are cases where, despite having a page with an asset publisher configured with that specific content, the search details do not lead to that page, but to an out-of-context view of the content.
- The issue seems to affect web content migrated from 6.1 to DXP 7.3 and not web content created directly in DXP.
Environment
- DXP 7.3
Resolution
- Opening the web content in edit mode and canceling without making any changes resolves the issue.
- Saving the web content asset publisher configuration without making any other changes also fixes the problem.
The issue occurs when web contents that have a defined in-context usage do not have references in the LAYOUTCLASSEDMODELUSAGE table. When the web content is opened in edit mode, even if changes are not saved, or when the asset publisher configuration is saved, the system executes code that checks for in-context usage in the journalcontentsearch table and adds the missing entries to the LAYOUTCLASSEDMODELUSAGE table.
The relationship between the layoutclassedmodelusage and journalarticle tables is based on the fact that the classPK field in layoutclassedmodelusage can correspond to the resourcePrimKey in JournalArticle.