Bug 807569 - EntityReferences are being replaced by a set of numbers
Summary: EntityReferences are being replaced by a set of numbers
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-28 08:01 UTC by Lee Newson
Modified: 2013-07-01 23:25 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-01 23:25:17 UTC


Attachments (Terms of Use)

Description Lee Newson 2012-03-28 08:01:26 UTC
In some cases EntityReferences get replaced by a set of random numbers. eg:

<para>
  This is an example of a para tag: &lt;para&gt;
</para>

gets replaced as 

<para>
  This is an example of a para tag: [2191002]para[-19028];
</para>

when saving the changes in SKynet.

I suspect this has to do with the fix for Bug #739466

Comment 1 Lee Newson 2012-03-28 08:15:34 UTC
Fixed in build 20120328-1753.

Cause:
When multiple EntityReferences were used in side a XML node that contained children nodes (see below for an example), the first node would be replaced and would increase the node count. Since the node count was only retrieved before processing any nodes, the count would be incorrect after the first iteration.

Example:
<para>
  This is an example of a para tag: 
  &lt;para&gt; <filename>/usr/bin/</filename> &lt;/para&gt;
</para>

Consequence:
Any EntityReferences that matched this case would be permanently converted to the temporary placeholder.

Fix:
Instead of getting the number of children nodes before iterating through and replacing the placeholders, I've made it calculate the number of children after each iteration.


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