dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Changing Theme of Designed Template not reflected in pages using it #6585

Closed dsilvam closed 10 years ago

dsilvam commented 10 years ago

Steps to reproduce:

  1. Create a Designed Template with OpenBank Theme
  2. Create a page and choose the template from 1
  3. Add some content and check the live version of the page (should see OpenBank Theme)
  4. Edit the Designed Template and change the Theme to Quest
  5. Save and Publish Template
  6. Check live version of page again

Error:You will notice that the page shows the old theme instead of the new. If you go to the template list and right click on the template and click 'publish', it works.

wezell commented 10 years ago

Did we check the Page cache?

dsilvam commented 10 years ago

@wezell : I got the fix which I will include in a hotfix. We were missing this:

https://github.com/dotCMS/core/blob/b0c2e85aab6e8f79e07bbfd8a5f943e7fe39f130/src/com/dotmarketing/portlets/templates/action/PublishTemplatesAction.java#L108 (meaning looking for pages using the template and invalidating them)

when hitting "save and publish" inside the Template.

We call that code when right clicking over the Template and hitting save.

I am moving it to the API in the fix, not to have it repeated on both actions

jtesser commented 10 years ago

Need to back port the fix above

dsilvam commented 10 years ago

fix for this issue here https://github.com/dotCMS/support/blob/master/hotfixes/hotfix-GIT-6587-v2.5.6/src/com/dotmarketing/factories/PublishFactory.java and here https://github.com/dotCMS/support/blob/master/hotfixes/hotfix-GIT-6587-v2.5.6/src/com/dotmarketing/portlets/templates/action/PublishTemplatesAction.java

jtesser commented 10 years ago

Ensure we test out https://github.com/dotCMS/core/issues/6587 when we apply the fix. The issue here is that the Template Velocity Object is NOT removed from the cache when you switch the theme and save. We need to call TemplateServices.inValidate() when this happens. Make sure you use a commitListener for this.

jtesser commented 10 years ago

I need a pull request in BOTH core and core-2.x

bryanboza commented 10 years ago

Fixed, Tested in nightly build 2014-10-31 // FF // Postgres