[jifty-devel] Display information before deleting a record (partial patch included)

Henry Baragar Henry.Baragar at instantiated.ca
Thu Nov 30 10:46:05 EST 2006


Hello,

I would like to display parts of a record to our users before deleting the 
record.  I would also like to use the same (or similar) css that is used for 
creating or updating a customer.  

So, I made the following modification:

--- /usr/local/share/perl/5.8.4/Jifty/Action/Record/Delete.pm   2006-05-25 
00:15:01.000000000 -0400
+++ Jifty/Action/Record/Delete.pm       2006-11-30 10:33:08.000000000 -0500
@@ -31,7 +31,11 @@

 sub arguments {
     my $self = shift;
-    my $arguments = {};
+    my $arguments = $self->SUPER::arguments(@_);
+
+    for my $column ( $self->record->columns ) {
+       $arguments->{$column->name}{'render_mode'} = 'read';
+    }

     for my $pk (@{ $self->record->_primary_keys }) {
         $arguments->{$pk}{'constructor'} = 1;

This has the desired effect except that the take_action no longer deletes the 
record and I get the following errors from the server:

WARN - Subroutine arguments redefined 
at /home/henry/clients/pure/Billing/lib/Jifty/Action/Record/Delete.pm line 
32.
WARN - Subroutine take_action redefined 
at /home/henry/clients/pure/Billing/lib/Jifty/Action/Record/Delete.pm line 
56.
WARN - Subroutine report_success redefined 
at /home/henry/clients/pure/Billing/lib/Jifty/Action/Record/Delete.pm line 
77.

Is this problem arising because of confusion between my local version of 
Delete.pm and the system one?  Or is there something else happening where 
calling SUPER::arguments causes a problem for the take_action in Delete.pm?

Regards,
Henry

ps.  Are we supposed to supply tests with submitted patches?  HB


More information about the jifty-devel mailing list