Issue
- When a site contains a large number of pages when creating a "Link to Page of this site" page then clicking on "Select" the Popup window's load time is long.
- To reproduce:
- On a site with a very large number of pages(14000 pages during our test)
-
Go to Site Builder --> Pages --> and create a "Link to Page of this site" page.
-
Click the "Select" button on the created Page.
-
Observe the popup.
- Actual Result: It takes a long time to display the pages (for me it took around 10 seconds).
-
Expected Result: The popup should display the pages right away.
Environment
- DXP 7.3+
Resolution
-
This is an unintended behavior and has been reported and addressed in the following tickets:
- Please Open a help center ticket to request a hotfix containing the above mentioned LPS tickets.
Additional Information
- In case you would like to test this behavior in a vanilla instance you can use the following script to generate the pages:
-
Run the following script to generate around 14000 pages by navigating to System --> Server Administration --> Script:
-
import com.liferay.petra.string.StringPool; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.model.Group; import com.liferay.portal.kernel.model.Layout; import com.liferay.portal.kernel.model.LayoutConstants; import com.liferay.portal.kernel.service.GroupLocalServiceUtil; import com.liferay.portal.kernel.service.LayoutLocalServiceUtil; import com.liferay.portal.kernel.service.ServiceContext; import com.liferay.portal.kernel.service.ServiceContextThreadLocal; public class LayoutGenerator { def chars = ['a','b','c','d','e','f','g','h','i','j','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] as char[]; public void execute() { try { ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext(); Group group = GroupLocalServiceUtil.fetchFriendlyURLGroup(serviceContext.getCompanyId(), "/myportal"); if ( group!=null ) { generateLayouts("pagin", 0, 4, 11 , group, serviceContext); } else { log.info("NO GROUP FOUND"); } } catch (Throwable e) { log.error(e.getMessage(), e); } finally { } } public void generateLayouts(String name, long parentLayoutId, int level, int count, Group group, ServiceContext serviceContext) { try { if ( level<= 0) { return; } if ( count > chars.length ) { count = chars.length; } long userId = serviceContext.getUserId(); long groupId = group.getGroupId(); boolean isPrivateLayout = false; String title = ""; String description = ""; String type = LayoutConstants.TYPE_PORTLET; boolean isHidden = false; String friendlyURL = StringPool.BLANK; for (int i = 0; i < count; i++) { try { String realName = name.concat(String.valueOf(chars[i])); Layout layout = LayoutLocalServiceUtil.addLayout( userId, groupId, isPrivateLayout, parentLayoutId, realName, title, description, type, isHidden, friendlyURL, serviceContext); log.info(realName); generateLayouts(realName, layout.getLayoutId(),(level-1), count, group, serviceContext); } catch (Exception e) { throw e; } } } catch (Throwable e) { log.error(e.getMessage(), e); } finally { } } Log log = LogFactoryUtil.getLog("LayoutGenerator"); } (new LayoutGenerator()).execute();
-