Bug 750975 - "Refresh HTML" loses changes I have just made to the XML
Summary: "Refresh HTML" loses changes I have just made to the XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Matthew Casperson
QA Contact: Misty Stanley-Jones
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-03 04:18 UTC by Misty Stanley-Jones
Modified: 2014-08-04 22:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-02 00:33:49 UTC


Attachments (Terms of Use)

Description Misty Stanley-Jones 2011-11-03 04:18:22 UTC
[13:52] <misty> When I "Refresh HTML" skynet seems to be reverting changes I made to the actual XML
[13:52] <misty> topic 5398
[13:52] <misty> I have changed the title and the <formlpara> and </formlpara> tags twice now, and when I Refresh HTML, they revert
[14:15] <mcasperson> misty - i think i know what that is. submit a bug and i'll take a look

Comment 1 Matthew Casperson 2011-11-07 02:52:40 UTC
Fixed in 20111107-1246

This was caused by a database race condition:

1. the user edits and saves a topic
2. the saved topic starts a thread to refresh the html view
3. the thread gets a copy of the current topic (possibly with old data depending on whether the XSL transforms had been processed or not)
4. the topic is saved with the changes made by the user
5. the thread renders the HTML, and saves again with the old data

The end result is that it appears that changes to the topic are not saved. However. no data has been lost - the edits made by the user are available under the topic history. Any topics that have been affected can simply copy the XML from the historical version and paste it into the latest version.

The code has been changed so that a background thread will only save the rendered HTML code, and not affect any other fields on the topic. This way the only issue that may arise from the background HTML rendering threads saving a topic entity before the original entity has been update is that an outdated HTML view being saved.


Note You need to log in before you can comment on or make changes to this bug.