Greetings,
 
$filter_module is a string. $object is well, an object.
If my Koha::Filter::MARC::ViewPolicy (to borrow a naming convention from you) wants to store its parameters for the filter function to access ($self->{options} = $params->{options}; in the initialize() ), this seems like the better patch to do so. Though, I guess you could do it both ways.
 
GPML,
Mark Tompsett
 
Sent: Friday, July 24, 2015 5:27 PM
Subject: Re: [Koha-devel] Koha::RecordProcessor question
 
When I first read it I felt something needed re-organization. But in the end I understood it was almost as we wanted.
What I changed was this:
https://github.com/tomascohen/koha/commit/8e7ec43bc0cfda24ef264c7144f9fc60a8d807a4
 
And if you notice, $param already contains the initialization options on his 'options' attribute.
 
Kind regards
 
2015-07-24 16:40 GMT-03:00 Mark Tompsett <mtompset@hotmail.com>:
Greetings,
 
I am beginning my work on bug 11592 the filter version. I was curious if this patch makes sense:
 
diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm
index 9bb1fc2..a345156 100644
--- a/Koha/RecordProcessor.pm
+++ b/Koha/RecordProcessor.pm
@@ -103,7 +103,7 @@ sub new {
         my $filter_module = $filter =~ m/:/ ? $filter : "Koha::Filter::${schema}::${filter}";
         if (can_load( modules => { $filter_module => undef } )) {
             my $object = $filter_module->new();
-            $filter_module->initialize($param);
+            $object->initialize($param);
             push @filters, $object;
         }
     }
 
Because otherwise, how can I properly set some parameters?
 
GPML,
Mark Tompsett

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


 
--
Tomás Cohen Arazi
Prosecretaría de Informática
Universidad Nacional de Córdoba
✆ +54 351 5353750 ext 13168
GPG: B76C 6E7C 2D80 551A C765  E225 0A27 2EA1 B2F3 C15F