Bug 61812 - Forms in sidebar do not work (test case)
Summary: Forms in sidebar do not work (test case)
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: sidebar (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-29 19:28 UTC by Steffen Weber
Modified: 2003-10-02 02:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Weber 2003-07-29 19:28:13 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

I've created a sidebar with a simple form containing one text input field. When clicking the submit button simply nothing happens. Test case: http://steffenweber.net/konqueror_sidebar_bug/index.html

Notice that omitting the target attribute of teh form-tag does not cause the error, I've tried that.

However, if you open the sidebar (http://steffenweber.net/konqueror_sidebar_bug/sidebar.html) directly in your main Konqueror windows (e.g. not as sidebar) the form works!
Comment 1 George Staikos 2003-07-29 19:30:41 UTC
Yes it's a known bug and on my TODO list, but due to a limitation in KHTML it 
might be very difficult to fix cleanly before KDE 4. 
Comment 2 George Staikos 2003-10-02 01:16:49 UTC
Subject: kdelibs/khtml

CVS commit by staikos: 

Notification support (to circumvent missing virtual + protected of submitForm())
required to fix #61812

CCMAIL: 61812@bugs.kde.org

Also fixes a potential crash with the js bug notifier


  M +25 -3     khtml_part.cpp   1.915
  M +41 -1     khtml_part.h   1.236
  M +2 -0      khtmlpart_p.h   1.48



Comment 3 George Staikos 2003-10-02 01:34:03 UTC
Almost have this working... 
Comment 4 George Staikos 2003-10-02 01:35:10 UTC
Subject: kdebase/konqueror/sidebar

CVS commit by staikos: 

Most of #61812.  Submits are now redirected properly but the data doesn't seem
to go through properly.  Needs debugging.

CCMAIL: 61812@bugs.kde.org


  M +23 -0     sidebar_widget.cpp   1.115
  M +5 -0      sidebar_widget.h   1.50
  M +4 -0      web_module/web_module.cpp   1.12
  M +32 -1     web_module/web_module.h   1.18



Comment 5 George Staikos 2003-10-02 02:25:05 UTC
Subject: kdebase/konqueror/sidebar

CVS commit by staikos: 

*Finally* fix the sidebar with respect to forms.

CCMAIL: 61812-done@bugs.kde.org


  M +1 -1      sidebar_widget.cpp   1.116
  M +10 -2     web_module/web_module.h   1.19


--- kdebase/konqueror/sidebar/sidebar_widget.cpp  #1.115:1.116
@@ -1017,5 +1017,5 @@ KParts::URLArgs args;
         args.postData = formData;
         args.setDoPost(QCString(action).lower() == "post");
-        // FIXME: boundary?
+        // boundary?
         emit getExtension()->openURLRequest(url, args);
 }

--- kdebase/konqueror/sidebar/web_module/web_module.h  #1.18:1.19
@@ -121,10 +121,18 @@ class KHTMLSideBar : public KHTMLPart
                                 const QString& boundary) {
                         QString t = target.lower();
-                        QString u = completeURL(url).url();
+                        QString u;
+
+                        if (QCString(action).lower() != "post") {
+                                // GET
+                                KURL kurl = completeURL(url);
+                                kurl.setQuery(formData.data());
+                                u = kurl.url();
+                        } else {
+                                u = completeURL(url).url();
+                        }
 
                         // Some sites seem to use empty targets to send to the
                         // main frame.
                         if (t.isEmpty() || t == "_content") {
-                                kdDebug() << "submitting form to the main page" << endl;
                                 emit submitFormRequest(action, u, formData,
                                                 target, contentType, boundary);