[Pkg-catalyst-maintainers] Bug#330387: should redirect user after action to reload problems

Joachim Breitner nomeata at debian.org
Tue Sep 27 20:43:48 UTC 2005


Package: libcatalyst-modules-perl
Version: 0.03
Severity: normal
File: /usr/share/perl5/Catalyst/Model/CDBI/CRUD.pm
Tags: patch

Hi,

the current CRUD module will not change the address after a change (add
or destroy), causing trouble when the user is reloading, or navigating
using the Browser's forward and back buttons (either creating additional
objects or barking about non-existant objects to delete.

Instead, the user should be redirected to the listing after the work is
done. The attaced patch does just that.

Thanks,
Joachim


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.otto
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages libcatalyst-modules-perl depends on:
ii  libcatalyst-model-cdbi-perl   0.08-1     CDBI Model Class for Catalyst
ii  libcatalyst-perl              5.33-1     The Elegant MVC Web Application Fr
ii  libcatalyst-plugin-formvalida 0.02-1     FormValidator for Catalyst
ii  libcatalyst-plugin-session-fa 0.12-3     FastMmap sessions for Catalyst
ii  libcatalyst-view-tt-perl      0.12-1     Template View Class for Catalyst
ii  libclass-dbi-asform-perl      2.42-1     Produce HTML form elements for dat
ii  libclass-dbi-fromform-perl    0.03-1     Perl module to update Class::DBI d
ii  libclass-dbi-plugin-retrievea 1.01-3     A more complex retrieve_all() meth
ii  libpath-class-perl            0.12-1     Cross-platform path specification 
ii  libtemplate-plugin-class-perl 0.12-2     Call methods of arbitrary classes 
ii  perl                          5.8.7-5    Larry Wall's Practical Extraction 

libcatalyst-modules-perl recommends no packages.

-- no debconf information
-------------- next part --------------
--- /usr/share/perl5/Catalyst/Model/CDBI/CRUD.pm	2005-08-10 16:31:13.000000000 +0200
+++ /usr/local/share/perl/5.8.7//Catalyst/Model/CDBI/CRUD.pm	2005-09-27 22:39:29.000000000 +0200
@@ -72,7 +72,8 @@
 sub destroy {
     my ( $self, $c ) = @_;
     $c->stash->{item}->delete;
-    $c->stash->{template} = 'list';
+    #$c->stash->{template} = 'list';
+    $c->res->redirect('../list');
 }
 
 =head3 do_add
@@ -84,7 +85,8 @@
 sub do_add {
     my ( $self, $c ) = @_;
     $self->create_from_form( $c->form );
-    $c->stash->{template} = 'list';
+    #$c->stash->{template} = 'list';
+    $c->res->redirect('list');
 }
 
 =head3 do_edit


More information about the Pkg-catalyst-maintainers mailing list