If the Dashboard is running for a specific site, once we go to this portlet and select the Site, we should get a list of the total amount of:
Pages.
Files.
Contents.
Current Behavior
We are getting an exception in logfiles and the "Oops" error message in the browser
This is happening on the Dashboard API classes. The getTopAssets() method returns a Cast exception because the amount of Pages it should retrieve is NULL. This is caused by a improper way to retrieve pages (both Legacy and Pages as contents). Once ALL pages are migrated to contents, the Dashboard breaks because the piece of code that counts Legacy Pages doesn't work properly.
Possible Solution
Improve database queries from the method that fails.
Known Workarounds
None.
Steps to Reproduce (for bugs)
In demo site (running 3.6.2), make sure all pages are migrated as contents. On demo, only one page is a Legacy one (/application/ajax/location-clickstream.html, so migrate as content.
Go to Sites portlet and select demo.dotcms.com. Enable Dashboard Run for this site, and then Save/Publish it.
Go to Dashboard portlet and select "demo.dotcms.com" site.
SELECT identifier.host_inode AS host_inode,
(COUNT(contentlet.inode) + (SELECT COUNT(*)
FROM htmlpage_version_info pageinfo JOIN identifier ON (identifier.id = pageinfo.identifier)
WHERE identifier.host_inode = '48190c8c-42c4-46af-8d1a-0cd5db894797'
AND pageinfo.live_inode IS NOT NULL GROUP BY identifier.host_inode)) AS count, 'htmlpage' as asset_type
FROM contentlet_version_info contentinfo
JOIN identifier ON (identifier.id = contentinfo.identifier)
JOIN contentlet ON (contentlet.identifier = identifier.id)
JOIN structure ON (contentlet.structure_inode=structure.inode)
WHERE identifier.host_inode = '48190c8c-42c4-46af-8d1a-0cd5db894797' AND structure.structuretype = 5
AND contentinfo.live_inode IS NOT NULL
GROUP BY identifier.host_inode
UNION ALL
SELECT identifier.host_inode AS host_inode,
count(*) AS count, 'file_asset' AS asset_type
FROM ((SELECT identifier, live_inode FROM fileasset_version_info) UNION ALL
(SELECT identifier, live_inode FROM contentlet_version_info WHERE EXISTS
(SELECT * FROM contentlet cc JOIN structure st ON (cc.structure_inode = st.inode)
WHERE contentlet_version_info.identifier=cc.identifier AND
st.structuretype=4 ))) ainfo
JOIN identifier ON (identifier.id = ainfo.identifier)
WHERE identifier.host_inode = '48190c8c-42c4-46af-8d1a-0cd5db894797' AND ainfo.live_inode IS NOT NULL
GROUP BY identifier.host_inode
UNION ALL
SELECT identifier.host_inode as host_inode,
COUNT(contentlet.inode) AS count, 'contentlet' AS asset_type
FROM contentlet_version_info contentinfo JOIN identifier ON (identifier.id = contentinfo.identifier)
JOIN contentlet ON (contentlet.identifier = identifier.id) JOIN structure ON (contentlet.structure_inode = structure.inode)
WHERE identifier.host_inode = '48190c8c-42c4-46af-8d1a-0cd5db894797' AND structure.structuretype<>4 AND
structure.structuretype<>5 AND contentinfo.live_inode IS NOT NULL
GROUP BY identifier.host_inode;
Expected Behavior
If the Dashboard is running for a specific site, once we go to this portlet and select the Site, we should get a list of the total amount of:
Current Behavior
We are getting an exception in logfiles and the "Oops" error message in the browser
This is happening on the Dashboard API classes. The getTopAssets() method returns a Cast exception because the amount of Pages it should retrieve is NULL. This is caused by a improper way to retrieve pages (both Legacy and Pages as contents). Once ALL pages are migrated to contents, the Dashboard breaks because the piece of code that counts Legacy Pages doesn't work properly.
Possible Solution
Improve database queries from the method that fails.
Known Workarounds
None.
Steps to Reproduce (for bugs)
Query:
Results:
Context
Reported by customer: https://my.dotcms.com/tickets/detail.dot?id=8af5d9ad-adc7-43af-a5fa-36a2a143cef9
Your Environment