Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.0 DXP SP2, Master
-
7.0.x
-
Committed
Description
When retrieving a portlet from the portlet pool, Liferay strips the JS-unsafe characters from the name before attempting to lookup the portlet from the portlet pool.
However, for an OSGi portlet, Liferay does not strip the JS-unsafe characters before storing it to the portlet pool.
https://github.com/liferay/liferay-portal/blob/7.0.2-ga3/modules/apps/static/portal-osgi-web/portal-osgi-web-portlet-tracker/src/main/java/com/liferay/portal/osgi/web/portlet/tracker/internal/PortletTracker.java#L125-L126
https://github.com/liferay/liferay-portal/blob/7.0.2-ga3/modules/apps/static/portal-osgi-web/portal-osgi-web-portlet-tracker/src/main/java/com/liferay/portal/osgi/web/portlet/tracker/internal/PortletTracker.java#L327
https://github.com/liferay/liferay-portal/blob/7.0.2-ga3/modules/apps/static/portal-osgi-web/portal-osgi-web-portlet-tracker/src/main/java/com/liferay/portal/osgi/web/portlet/tracker/internal/PortletTracker.java#L977-L978
https://github.com/liferay/liferay-portal/blob/7.0.2-ga3/portal-impl/src/com/liferay/portal/service/impl/PortletLocalServiceImpl.java#L302
This behavior is inconsistent and results in Liferay not recognizing that a portlet is available when it is deployed. We need to either disallow JS-unsafe characters prior to registering the portlet (similar to what we do when the portlet name is too long) or we need to strip the JS-unsafe characters when generating the portlet ID.
As such, Portlets with dashes in the name default to `undeployed` and are unable to be added to sites.
Steps to Reproduce:
1. Start up a clean Liferay DXP bundle.
2. Deploy the attached test portlet: com.liferay.training.hello.portlet.jar
3. Navigate to the App Manager and search for 'hello' to verify that the portlet has deployed successfully.
4. Attempt to add the portlet to a page.
Expected: Portlet deploys successfully and is available to add to pages.
Actual: Portlet deploys successfully, but is not available to add to pages.
Additional Testing:
7.0.x: 3e49837722aee7b9706ced5dea813b9092e8a6e3
Issue reproduced in branch.
Master: 473382f24854e2cf99ff6fa657cbb1c26af02c40
Issue reproduced in master.
Attachments
Issue Links
- causes
-
LPS-69811 Portlets without explicit portlet name added to a page before LPS-69002 fail to appear on pages
- Closed
- is caused by
-
LPS-49410 Portlets created as inner classes create incompatible portlet ids
- Closed
-
LPS-49241 Allow component portlets to use the portlet class name as the portlet name automatically
-
- Closed
-
- is related to
-
LPS-69447 Unnecessary dollar sign formatting for PortletIds
- Closed
- relates
-
LPS-69104 Portlets with periods in name do not work with service builder, resulting in BeanLocatorException when the portal attempts to reference them
- Closed
- links to