Search code examples
liferayliferay-6liferay-theme

Users in Guest role see default theme instead custom one for given layouts


Users in Guest role see default theme instead custom one for pages which inherit from defined custom theme. This seems to be very strange problem.

Even though layouts have specified to inherit theme from parent theme:

Use the same look and feel of the Public Pages.

Guests see them as the one with regular Liferay theme. Any idea what can be causing such issue? Or anyone experienced similar problem?

I am almost sure this problem is related to layout revision functionality which we are using on our portal (or however is it called). From other hand, useful will be information about how Liferay is using these tables:

  • layout
  • layoutbranch
  • layoutfriendlyurl
  • layoutprototype
  • layoutrevision
  • layoutset
  • layoutsetbranch
  • layoutsetprototype

And how theme is inherited for layouts which defined option "Use the same look and feel of the Public Pages"? Where this information is stored for each layout, which tells him to use parent theme instead his own defined one? Where parent theme information is stored (the one defined in Public Pages first layout tree element)?

Thanks for any information, which helps me to understand this mechanism and maybe solve my problem.


Solution

  • After few hours consumed on analyzing our portal environment finally I managed to solve it. Here is the reason of such strange problem:

    It turns out, the information about main parent theme (the one which can be inherited on child pages) is stored in different places for such options enabled on portal:

    • different for option : Page Versioning - > Enabled On Public Pages
    • different for option : Page Versioning - > Disabled On Public Pages

    And after disabling such option it turns out main theme was set to default one, while with option enabled it was set to correct one.

    Solution we used was to disable option of page versioning, change main parent theme for public sites, and then enable option of page versioning back again.

    By the way, if you are awere of losing some important data configured on your versioned layouts, be sure to make backup before you start. I ended up with blank pages and had to restore it.