Issue
- The usage count in 'view usages' does not change when the web content is embedded through the theme
- Create 'Site'
- Create 'Content Pages'
- Create 'Web Content'
- Copy the friendly URL of the above web content
- Deploy the custom theme.
- Go to the 'Site Builder' > page configuration > change the current theme and apply custom theme
- After applying the theme, three below options would receive, replace "Footer-Friendly-Id" with the web content-friendly URL which was copied on step 4.
'SignIn-Friendly-Id' ,'SignOut-Friendly-Id' & 'Footer-Friendly-Id' (part of custom theme) - Go to the site, web content would be visible.
- Control panel> web content > (created web content)> view usages
- Zero (0) count is present.
Expected Behaviour: View usages should display as many pages as created in step#2.
Observed Behaviour: View usages showing 0 counts.
Environment
- Liferay 7.2 DXP-5
Resolution
The theme doesn't contain conversion from Long to String in the init_custom.ftl
<#assign journalArticlePreferencesMap = {
"portletSetupPortletDecoratorId": "barebone",
"groupId": getterUtil.getString(group_id?c),
"articleId": getterUtil.getString(journalArticle.getArticleId())
} />
Note: The ?c in the groupId line.
Using this in a clean environment should result in increased view usages count.
To fix this in a previously established environment, need to remove the old portlet preferences.
'Clean Up Orphaned Theme Portlet Preferences' will clear up most of these (and any other orphaned portlet, be careful), but one row might need manual clear up from the DB. That one should be identifiable with the following query, please fill out <groupId> and <instanceId>
SELECT * FROM portletpreferences WHERE ownerId=<groupId> AND ownerType = 3 AND portletId = "com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_<instanceId>"