Hi,
I am having difficulty locating the source of an error where the
contents of a TextArea property for a custom class object on a page
ends up rendering in a WYSIWYG box as wiki syntax (as in, displaying
the actual code in one long paragraph). "Corrupt" is probably not the
right word for this, as I'm sure it's something I'm doing wrong...
Simple explanation:
1) User clicks a button to add a new instance of a class to the page,
which also enters the Inline Editing mode. User pastes content into a
WYSIWYG editor and saves the page. After save, the TextArea property
shows up correctly in view mode with $doc.display(), with headings,
formatting, etc...
2) Something happens - I cannot yet reproduce it, but I'm sure the
user is doing something.
3) The object starts displaying the property as a single block of text
with embedded wiki syntax, mostly what looks like custom parameters
containing the formatting info, such as:
(% class="MsoNoSpacing" %) (% class="tagChar" style="font-size:
12pt;" %)
etc...
Even in inline edit mode, the contents of the WYSIWYG box have been
replaced with this block of code, which does not appear with the
actual formatting - just the raw code.
Looking into the page history, there is a version of the page saved
right before the property becomes "corrupt." So something must be
happening to trigger the conversion of the TextArea content into wiki
syntax, which then gets saved over the original data.
The pages the user is using have multiple objects of the same class,
all displaying their TextArea properties in a table. The majority of
the time, it displays perfectly. This only applies to some objects on
the page - though sometimes all objects on a page will simultaneously
exhibit this behavior.
The pages also contain buttons to create a new object, as well as a
button to delete each object individually.
I have one reliable method of producing this error. I used to have the
"delete this object" button display while in Inline Edit mode -
clicking it while in that mode would cause to entry to "convert." I
suppressed the button from displaying unless in view mode, which
removed this cause of the error - but there is still some other
mechanism for generating the same behavior.
Here's an example of the delete button code which I can use to cause
similar behavior:
#set($delurl =
"/xwiki/wiki/$doc.getWiki()/objectremove/$doc.getSpace()/$doc.getName()?classname=Sandbox.TestClass&classid=$obj.getNumber()&xredirect=$doc.getURL()")
<input
type="image"
onclick="location.href='$delurl'"
value="Delete"
title="Delete"
style="float:right;"
src="/xwiki/resources/icons/silk/cross.gif" />
Any ideas on what's happening?
Thanks much,
aaron