Hi Aaron, On Fri, Nov 18, 2011 at 11:37 PM, Ashtar Communications <[email protected]> wrote:
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;" %)
Is this the text displayed in view mode or the value of the TextArea property as seen when editing the page with the Object editor? I'd like to know the value from the Object editor.
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
How can the deleted object become corrupted? I suppose you are referring to the other objects of the same type from the same page. Which one gets corrupted? All? Always all?
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()")
Unrelated to your problem, you should never build the URL manually. Use instead $doc.getURL($actionName, $queryString).
<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?
What do you mean when you say that the "entry" is "converted" when you click on the delete button. AFAICS the delete button doesn't submit the inline form (so any changes will be lost) and it redirects to view mode after the object is deleted. Are you saying that the TextArea properties are corrupted as soon as you end up in view mode after the object has been removed? If so, then you should see in the history that the revision that deleted the object also modified the TextArea properties. I doubt it. Are you using the browser back button or the edit menu to go back to inline edit mode after deleting an object? I'm pretty sure you are using the back button in order to not loose unsaved changes made before clicking the delete object button. If so, then you could be experiencing http://jira.xwiki.org/browse/XWIKI-7028 . Hope this helps, Marius
Thanks much,
aaron _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users