cancel
Showing results for 
Search instead for 
Did you mean: 

ContentPage with homepage flag does not synchronize from CMSCockpit

Former Member
0 Kudos

Hi, i am trying to synchronize a new ContentPage from Staged to Online, the changes i made were to flag this page as a "homepage". If i synchronize the entire catalog from the HMC, this works fine but when i synchronize the entire catalog from the CMSCockpit, the synchronization finishes and all pages that had the "homepage" flag set to true are now set to false. I recently updated to Hybris 5.7 and previously this mechanism worked fine. Is there any kind of documentation regarding this issue or how the homepage flag is supposed to be handled? Is there a way to fix this? Thanks Alessandro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hey, the following solution works great for me.

 public class YourClassName extends CmsContentPagePrepareInterceptor
 {
     @Override
     protected void resetHomepageFlag(Collection<AbstractPageModel> contentPages, ContentPageModel currentPageModel, InterceptorContext ctx)
     {
         if (this.getCmsAdminPageService().getActiveCatalogVersion().equals(currentPageModel.getCatalogVersion()))
         {
             super.resetHomepageFlag(contentPages, currentPageModel, ctx);
         }
     }
 }

Don't forget to override der original Spring-Bean (same id):

 <bean id="contentPagePrepareInterceptor" class="your.package.YourClassName"
         scope="tenant" autowire="byName">
         <property name="cmsAdminPageService" ref="cmsAdminPageService"></property>
     </bean>

or create an new bean with your class and override the mapping.

 <bean id="myNewBean" class="your.package.YourClassName"
             scope="tenant" autowire="byName">
             <property name="cmsAdminPageService" ref="cmsAdminPageService"></property>
         </bean>
 <bean id="contentPagePrepareInterceptorMapping" scope="tenant" class="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">
             <property name="interceptor" ref="myNewBean" />
             <property name="typeCode" value="ContentPage" />
         </bean>
 

To the problem: Given an online and a staged catalog version. During a synchonisation the prepare interceptor is called on the online item. The interceptor loads the current active catalog version - but that is the staged and not the online version. Accordingly, they get a list of all staged ContentPages and compare them with the online version item. Therefore it detects that there is another item with an active homepage-flag and sets the attribute to false.

My fix: Only use the original logic if the catalogVersion of the currentPageModel equals the sessionCatalogVersion. That happens if you have a normal change on the item / a normal save-action.

former_member560975
Participant

Almost 2 years later, the problem is still present in the Hybris code and needs the same fix.

Answers (5)

Answers (5)

former_member560975
Participant
0 Kudos

This issue has been fixed in Commerce 1808. We used to have a custom extension of the CmsContentPagePrepareInterceptor#resetHomepageFlag where we checked that the catalog version of the page being modified is the same as the catalog version of the pages for which to reset the flag, but this is now done in the default code, by looking up for the pages in the same catalog version as the modified page.

Former Member
0 Kudos

We would be also interessted for an solution, as we face the same in 6.6.

Thanks, Anja

Former Member
0 Kudos

Hi ,

We are also facing the same issue in 6.6 version , is there any solution for this ?

Thanks, Nikhil

Former Member
0 Kudos

Hello,

Has there been any movement or solutions to this issue?

Former Member
0 Kudos

We have the same problem with Hybris 5.5.0.9 and 5.7.0.14.

When we make changes to the "homepage" (i.e. a page where the homepage flag is true) in WCMS, this is what happens:

  • the sync icon turns red

  • we sync the page clicking on the red icon; the icon stays red and, if we reload the page, we see that now the homepage is set to false.

  • we sync again and the icon turns green, but the homepage flag is false in the catalogs, even if the user didn't change that.

On the other hand, if we sync the content catalog in hMC, the homepage flag remains true. It seems to be a problem only in WCMS.

Syncing in hMC is a workaround, however it is a serious problem because users work in WCMS and they may be unaware that they have now set the homepage to false which results in breaking the website (the homepage gives a "server error").