ist-dresden / composum-nodes

Set of Apache Sling / AEM development tools: JCR browser, user and package management and more
https://www.composum.com/home/nodes.html
MIT License
55 stars 21 forks source link

Cannot change a file in the composum editor #37

Closed ivoleitao closed 8 years ago

ivoleitao commented 8 years ago

Hi !

I've tried to change a html file that I've added to the repository via Sling-Initial-Content and there is no save on the repository. The editor does not complain of an error, it actually presents my changed content (in the text code view) but when I access the corresponding URL or when I preview the old content is presented. I'm using sling 8 and the latest version of composum avaliable.

To reproduce this issue an html file needs to be on the repository for example at /apps/components/test.html (or uploaded) and then we should select the text code view of the corresponding node and press edit text. In the edit view we should perform a change and press save.

The final outcome of this is a text code view with the changed content but when accessing directly via Display Rendered View for example the old content is still displayed.

I've tried to change permissions and the problem remais. I've also peeked at the log files but was unable to find any useful information so I'm a little lost right now.

ivoleitao commented 8 years ago

Hello again, I've debugged the code and actually this is even more strange than I thought initially.

I've looked at the PropertyUtil class which is called by the PropertyServlet after I hit the save button and apparently everything goes well. the statement property = node.setProperty(name, valueFactory.createValue(binary));

completes with success but no data is stored something very weird is happening...

ivoleitao commented 8 years ago

Okey,

This must be some kind of cache problem. If I open another browser window the content is indeed changed, what is odd is that in the previous session I still see the old content. Any idea what this could be ?

ivoleitao commented 8 years ago

Hi again :-) Sorry for the spamming but I think I've found the problem. To use composum as a way to edit content when the content is fetched (via Display Rendered View) some headers should be sent in the request to disable caching else after changing some html for example the user will see the previously cached browser page (on Display Rendered View or in another browser tab) and not the one that he/she has changed.

I think this is a matter of adding some headers for such requests to correct this problem.