Affects Version/s: 7.2.X, 7.3.X, Master
Component/s: SEO Tools > Sitemap Protocol
1.) Use a vanilla Liferay 7.0 with the latest fix pack.
2.) Start the system and create a new site and set a virtualhost to the it (please add this to your hosts file as well).
3.) Create a few pages and please check your virtualhost:8080/site/sitemap.xml
Result: You should see all the sites that you created in your site.
4.) Shutdown your system and make an upgrade to Liferay 7.2 (fix pack dxp-8).
5.) When the upgrade is finished start the system and check your virtualhost:8080/site/sitemap.xml.
Result: You won’t see any page entries. If you create a new layout with Liferay 7.2 then that will be part of the sitemap.xml.
I don’t know the root cause of the this, however, if I am not mistaking the uuid-es of the pages change during the upgrade and this might be one of the reasons.
7.2x @ commit (d352872096f3ddcb5cf652bf31ed897e24b2cbb1) reproduced
master @ commit (7f0d8da3d86724c398c4c31f4eee40287fb1f066) reproduced
Expected result: You can see all previously created pages and the new one in the sitemap.xml.
Actual result: Only the new page is referenced in the sitemap.xml.
- The query for layouts is created and ran in LayoutLocalServiceImpl.getAllLayouts(..).
- This query has a filter condition like "classNameId != 12345".
- The main difference between upgraded and newly created Layout records is that classNameId is null for the upgraded ones, while the new one has 0.
- A most likely solution can be to create an upgrade step that fills classNameId columns with 0.
- Another solution is to extend the filter condition to include "... OR classNameId IS NULL". However, that would probably affect the query performance as well.