Hi devs,

When nesting paragraphs, we are using the cms:loadPage to get the proper place to save/load the data within the nested par. On save though, while everything works fine, the metadata for the page itself, is not updated.

When looking at the SaveHandlerImpl class, the method save has the following:
---------------------------------
// update meta data (e.g. last modified) of this paragraph and the page
node.updateMetaData();
page.updateMetaData();
---------------------------------

but since, loadPage was called before, on something that was actually not a page, metadata is not updated, so lastmodified is not updated either and the status of the page is not properly reflected.
Adding the following piece of code, obviously solves the problem:
---------------------------------
Content rootPage =  page;
while(!hm.isPage(rootPage.getHandle())) rootPage = rootPage.getParent();
rootPage.updateMetaData();
---------------------------------

I haven't tested nested paragraphs in the latest magnolia code, but it seems that the same problem could appear. Should I patch the magnolia trunk on SaveHandlerImpl with the code above ? the LoadPage tag to throw an exception ?

Other ideas ?

Niko,

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to