Affects Version/s: 7.0.0 DXP SP2, Master
The BaseTextExportImportProcessor.validateLayoutReferences method fails to take into account that a URL might involve a friendly URL to a portlet (see https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-1/adding-friendly-url-mapping-to-the-portlet).
If you try to publish a web content article with a link consisting of a friendly URL to a portlet, the BaseTextExportImportProcessor.validateLayoutReferences method will parse the URL incorrectly, and ultimately, a NoSuchLayoutException will be thrown, preventing the article from being added.
Steps to Reproduce
- Start up Liferay on a fresh database and log in as the admin user.
- Navigate to Liferay > Content > Web Content > + (Add Button) > Basic Web Content.
- Give it a title (it doesn't matter what the title is).
- Switch the "Content" field to Code view.
- Paste the following HTML into the "Content" field:
Note: Although we have not created a portlet with the friendly URL testportlet, this doesn't matter. The validator is only supposed to validate the URL to the page; it should not validate whether or not the full URL points to an existing portlet
- Click on the Submit button
Expected result: The web content article is successfully added with no errors.
Actual result: An error appears in the UI: "The content references a missing page." The web content article is not added.