Le mie Attività

gennaio 28
Hai Yu ha aggiornato LPS-52734.
22.06
gennaio 27
Hai Yu ha aggiornato LPS-52099.
1.00
gennaio 25
Hai Yu ha aggiornato LPS-30788.
22.38
Hai Yu ha aggiornato LPS-43541.
21.45
Hai Yu ha aggiornato LPS-52400.
gennaio 23
Hai Yu ha aggiornato LPS-52804.
gennaio 22
Hai Yu ha aggiornato LPS-52772.
18.22
Hai Yu ha lasciato un commento su LPS-52927.
1.11 The issue was caused by friendlyURL filed of layout and layoutfriendlyurl table have different value when create layout by using page template and uncheck "Automatically apply changes done to the page template.". Please refer to the below explanation: 1. Create a new site template 2. Create a new site "Site" using template 3. Add a new page to the site called "testpage"(its friendlyURL is "testpage") 4. Create a page template "test1" 5. Add a page to the site template called "testpage", using page template "test1" and uncheck "Automatically apply changes done to the page template." to add the page *At this time, please see friendlyURL field (value:/testpage) of layoutfriendlyurl table and friendlyURL field(value:/3(layoutId)) of layout table. So for same layout and same language, they have different value and friendlyURL field(value:/3(layoutId)) of layout table is wrong* 6 Visit actual site again and the ERROR "Duplicate entry IX_A6FC2B28" will occur. When visit "Site", the process of propagation will start. In LayoutStagedModelDataHandler.doImportStagedModel() { 353 line String friendlyURL = layout.getFriendlyURL(); 406- 419 line LayoutFriendlyURL layoutFriendlyURL = LayoutFriendlyURLLocalServiceUtil.fetchFirstLayoutFriendlyURL(groupId, privateLayout, friendlyURL); if ((layoutFriendlyURL != null) && (existingLayout == null)) { return; } } *From 406-419 lines, if friendlyURL=3, it won't check the friendlyURL is conflicted between siteTemplate page and "Site" page. And siteTemplate page "testpage" will be imported. Later, it will invoke below code:* 632 line importLayoutFriendlyURLs(portletDataContext, layout); // it will invoke importLayoutFriendlyURLs() 984 line. In importLayoutFriendlyURLs(){ *It will use datas of layoutfriendlyurl table to import related friendlyURL. However, friendlyURL field of layoutfriendlyurl table is "/testpage", it will conflict with existed "Site"'s "testpage" so that the issue occured.* } *So the issue occurs due to generated friendlyURL field's value("/3") of layout table is wrong when create layout by using page template and uncheck "Automatically apply changes done to the page template.".* When add one layout by using page template and uncheck "Automatically apply changes done to the page template.", it will invoke the below code fragment in LayoutLocalServiceImpl.addLayout() { //383 line SitesUtil.applyLayoutPrototype(layoutPrototype, layout, layoutPrototypeLinkEnabled); } *At this time, adding related layoutFriendlyURL logic doesn't be executed yet.* So in SitesImpl.applyLayoutPrototype(){ *targetLayout.getFriendlyURLMap() (256 line) will always be "null" because adding related layoutFriendlyURL logic will be executed after this logic finished.* } So in LayoutLocalServiceStagingAdvice.updateLayout() { //249 line friendlyURLMap = layoutLocalServiceHelper.getFriendlyURLMap( groupId, privateLayout, layoutId, StringPool.BLANK, friendlyURLMap); //**friendlyURLMap will be handle for "{en_US=/3}" due to friendlyURLMap is null** } So the fix should firstly add previous validated the layout's friendlyURL and then execute following operation. Previous validated the layout's friendlyURL occur in LayoutLocalServiceImpl.addLayout() { //290-293 line friendlyURLMap = layoutLocalServiceHelper.getFriendlyURLMap( groupId, privateLayout, layoutId, name, friendlyURLMap); String friendlyURL = friendlyURLMap.get(LocaleUtil.getSiteDefault()); //325 line layout.setFriendlyURL(friendlyURL); } Please help review it. Thanks, Hai
Hai Yu ha aggiornato LPS-52927.
gennaio 20
Hai Yu ha aggiornato LPS-52927.
23.48
Inscriviti alle attività di Hai Yu. (Apri una nuova finestra)