legacy-knowledge-base
公開されました Sep. 10, 2025

Modal Size is Ignored for Guest Users when Using Liferay.Util.openModal()

written-by

Rishabh Agrawal

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

learn-legacy-article-disclaimer-text

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:

  1. Login to Liferay DXP 7.4 u90.
  2. Create an object along with some fields like (name, designation and imageurl) and publish the object.
  3. Create a widget page, drag and drop the created object into it.
  4. 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.
  5. Create a basic fragment and under the configuration, provide the code for HTML, CSS and JavaScript.
  6. Create a content page, drag and drop the widget "Collection Display" into it.
  7. Now, from the right panel, click on select collection-> Collection provider ->Select the object created.
  8. Again, from the right panel, select the layout as 4 columns.
  9. From the widgets section, select the created fragment [step 5], drag and drop it into one of the columns.
  10. 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.
  11. Finally, once all the values get populated in the content page, publish the page.
  12. Go to the widget page and enable view permission for the guest user for all the entries.
  13. Open localhost:8080 in a different browser. It is seen that the size of the card is small.
  14. 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.
did-this-article-resolve-your-issue

legacy-knowledge-base