On Thu, Aug 30, 2007 at 10:30:55AM +0530, Ligesh wrote:
> 
>  Hi,
> 
>   Elinks behaviour when I am trying to edit a page can cause some real 
> headaches. It happens when you are trying to edit an already edited page. 
> Even if you refresh, the text area will contain the older contents and if you 
> edit the second time, the changes you made during the first edit are lost, 
> and it gets horribly confusing too.
> 
>   I would like to know if this can be fixed. Reproduce it like this:
> 
>  a) Go to a an editable page, and click on edit.
> 
>  b) Make some changes and save. You will be redirected to the display page 
> again.
> 
>  c) Come back to the edit page and refresh.
> 
>  e) Expected result: The refreshed page should contain the new text.
> 
>  f) Actual result: The text area contains the older contents--the one before 
> you made the edit.
> 
>  You can workaround this by, simply going back, and coming to the page again 
> after you have refreshed the page. But that's not an ideal solution.
> 
>  Thanks a lot.

Try this patch.
Forget forms when reloading (bug 620 ?).

---
commit 2d69e2e625bb4e673e95bc7eb7b1d8744c4f9a87
tree 9438cfe5923b1ffca02a814356c6c1045b72b2f0
parent 940196b131f13537b84e807b14481280bf5b72f1
author Witold Filipczyk <[EMAIL PROTECTED]> Thu, 30 Aug 2007 19:36:48 +0200
committer Witold Filipczyk <[EMAIL PROTECTED]> Thu, 30 Aug 2007 19:36:48 +0200

 src/session/session.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/session/session.c b/src/session/session.c
index e82141c..ae9f350 100644
--- a/src/session/session.c
+++ b/src/session/session.c
@@ -1198,11 +1198,17 @@ reload(struct session *ses, enum cache_mode cache_mode)
        if (have_location(ses)) {
                struct location *loc = cur_loc(ses);
                struct file_to_load *ftl;
+               int i;
 
 #ifdef CONFIG_ECMASCRIPT
                loc->vs.ecmascript_fragile = 1;
 #endif
-
+               /* Forget forms. */
+               for (i = 0; i < loc->vs.form_info_len; i++)
+                       mem_free_if(loc->vs.form_info[i].value);
+               mem_free_set(&loc->vs.form_info, NULL);
+               loc->vs.form_info_len = 0;
+               free_list(loc->vs.forms);
                /* FIXME: When reloading use loading_callback and set up a
                 * session task so that the reloading will work even when the
                 * reloaded document contains redirects. This is needed atleast
_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to