Legacy Knowledge Base
Published Sep. 10, 2025

JournalContentSearchLocalServiceUtil.getLayoutIds returns an empty list

Written By

Daniel Martinez Cisneros

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When trying to retrieve the pages where a web content article is displayed using its articleId, an empty list is returned.
  • After instantiating a web content in a Content Viewer, the following method is used to obtain the layoutIds:
List<Long> layoutIds = JournalContentSearchLocalServiceUtil.getLayoutIds(themeDisplay.getScopeGroupId(), false, articleId);
  • The search returns an empty list. Checking the database, the JOURNALCONTENTSEARCH table has not been updated and there is no record relating the page to the web content.
  • However, if the following method is executed before the call described above:
JournalContentSearchLocalServiceUtil.checkContentSearches(themeDisplay.getCompanyId());
  • The JOURNALCONTENTSEARCH table is updated, reflecting the relationship between the page and the web content selected in the content viewer.

Environment

  • Liferay DXP 7.4 before update 64

Resolution

  • The JournalContentSearch table is not used directly in DXP versions 7.4 update 64 and later. An internal refactoring was performed, and this information is now stored in the LayoutClassedModelUsage table.
  • The commit in which this change was executed is linked to the Jira LPS-174322.
  • Although calling JournalContentSearchLocalServiceUtil.checkContentSearches(themeDisplay.getCompanyId()); populates the JournalContentSearch table, this table is no longer updated automatically by the product. The updated information is found in the LayoutClassedModelUsage table.
  • Use the following method to obtain the corresponding information:
LayoutClassedModelUsageLocalServiceUtil.getLayoutClassedModelUsages(...)

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base