Issue
- When using
Liferay.Util.openModal()within a fragment, the specified size (e.g.,size:"xl") is visible for only logged-in users, but it is ignored for guest users. - For guest users, the modal opens in a much smaller, default size, leading to an inconsistent user experience between authenticated and unauthenticated users.
Steps to reproduce:
- Login to Liferay DXP 7.4 u90.
- Create an object along with some fields like (name, designation and imageurl) and publish the object.
- Create a widget page, drag and drop the created object into it.
- Provide the values to the fields (name, designation and imageurl) one by one. Note: Please provide the link of image in imageurl field from the path: /home/me/Downloads/liferay-dxp-tomcat-7.4.13.u90-20230816105706384/liferay-dxp-7.4.13.u90/tomcat-9.0.75/webapps/ROOT/html.
- Create a basic fragment and under the configuration, provide the code for HTML, CSS and JavaScript.
- Create a content page, drag and drop the widget "Collection Display" into it.
- Now, from the right panel, click on select collection-> Collection provider ->Select the object created.
- Again, from the right panel, select the layout as 4 columns.
- From the widgets section, select the created fragment [step 5], drag and drop it into one of the columns.
- Click on the “name” field and from the right panel, map it with the name created under the object. Similarly, perform for the “designation” field.
- Finally, once all the values get populated in the content page, publish the page.
- Go to the widget page and enable view permission for the guest user for all the entries.
- Open localhost:8080 in a different browser. It is seen that the size of the card is small.
- Now login to the account and in this case, it is seen that the size of the card is large. [probably xl, as defined in the Liferay.Util.openModal].
Actual Result: When not logged in, the modal renders in a small size despite specifying size: "xl".
Expected Result: The modal should consistently open in extra-large size for all users, regardless of login status.
Environment
- Liferay DXP 7.4
Resolution
- This behavior is a known issue that has been addressed via LPD-30515. The fix ensures that the modal size parameter is applied correctly for both guest and logged-in users.
- Please submit a support ticket to get the hotfix on the same by attaching the patch details.
Additional Information
- Always upgrade the DXP to the latest update to achieve the expected behavior: Upgrade Basics
- Please submit a support ticket if you require more information from the product aspect by attaching patch details.
- Installing Fix Packs and Hotfixes on Liferay DXP will guide to installation of the hotfix in the respective environment.