fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-07-17 07:09 am

[dw-free] Posting on new update page with IE 404s after you preview

[commit: http://hg.dwscoalition.org/dw-free/rev/f142c42265f0]

http://bugs.dwscoalition.org/show_bug.cgi?id=4524

Specify the form action explicitly, to help make this work consistently
across all browsers.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Controller/Entry.pm
  • views/entry/form.tt
--------------------------------------------------------------------------------
diff -r 25229cf3cfd1 -r f142c42265f0 cgi-bin/DW/Controller/Entry.pm
--- a/cgi-bin/DW/Controller/Entry.pm	Mon Jul 16 21:36:49 2012 -0700
+++ b/cgi-bin/DW/Controller/Entry.pm	Tue Jul 17 00:12:34 2012 -0700
@@ -215,6 +215,11 @@
 
     $vars->{show_unimplemented} = $get->{highlight} ? 1 : 0;
     $vars->{betacommunity} = LJ::load_user( "dw_beta" );
+
+    $vars->{action} = {
+        url  => LJ::create_url( undef, keep_args => 1 ),
+    };
+
     return DW::Template->render_template( 'entry/form.tt', $vars );
 }
 
diff -r 25229cf3cfd1 -r f142c42265f0 views/entry/form.tt
--- a/views/entry/form.tt	Mon Jul 16 21:36:49 2012 -0700
+++ b/views/entry/form.tt	Tue Jul 17 00:12:34 2012 -0700
@@ -155,7 +155,7 @@
     <h2>[% 'entryform.form' | ml %]</h2>
 [%- END -%]
 
-<form method="POST" id="post_entry" action="" class="
+<form method="POST" id="post_entry" action="[% action.url %]" class="
         [%- formwidth == "narrow" ? "entry-partial-width" : "entry-full-width" -%]">
     <input type="hidden" id="nojs" value="1" name="nojs" />
 
--------------------------------------------------------------------------------