Item2453: Form data lost (fails to save) via ?action=form
Current State: Closed
Target Release: n/a
Steps to reproduce:
- Access a topic that has a form already attached to it via /bin/edit...?action=form appended, or use the "edit form data" widgeth in the top-right area of the form that's displayed in view mode.
- User is taken straight to the form tab of the editor (actually, the topic edit tab is absent, by design)
- Make some changes to form data.
- Press save
At this point, there is a defect:
- user is taken to the edit script again, except this time with the topic editor open, and the form tab has lost all the data that was entered previously.
- User should be taken (generally) back to view script, where he/she can see the changes they made saved to the topic.
Seems to be caused by a crazy
simply fails to find the edit form element.
Instead, pass document.getElementById('EditForm') into jQuery as the selector.
Very, very weird. There are som slight XHTML validation issues, I wonder if this is upsetting jQuery.
Confirmed on FF 3.0.12 and IE8.
Need to make a new release, so set waiting for Michael.
- 04 Dec 2009
The replacement of
with the equivalent
can't be correct.
Can you further describe the circumstance when this happens:
- are you using TinyMCEPlugin
- which skin are you using
- are there any other view or edit templates coming into play?
Thanks for tracking this down.
- 04 Dec 2009
Ok, I must be going crazy. I swear
that every time I would break on that $('#EditForm') line, running the jquery statement in the console failed to give me any results, whereas getElementById('EditForm') did
Who knows, firebug is kinda buggy... Anyway, you are right, it wasn't JQuery's fault.
The improved check for presence of TinyMCE
fixes the problem by itself. With
loads but does not start (there is no valid textarea to hijack).
The browser must have been simply following the <a href="../bin/edit.." link in the save button, because the JS thread was stopped with a "null object has no member onSubmit" error which disappeared too fast for me to see.
I should have used the browser's error console which preserves errors between page views, instead of firebug's console..
- 05 Dec 2009
Don't trust anybody that swears
- 07 Dec 2009
This is ready for release.
- 05 Feb 2010
: download http://svn.foswiki.org/trunk/NatEditPlugin/pub/System/NatEditPlugin/edit.js
replace those files in /pub/System/NatEditPlugin
- 06 Feb 2010