https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16960

            Bug ID: 16960
           Summary: Patron::Modifications should be fixed
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Patrons
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

The changes from opac-memberentry do not reach the table, since the
Patron::Modifications object does not work well.

Look at this from opac-memberentry:
    Koha::Patron::Modifications->new( borrowernumber => $borrowernumber );
Passing borrowernumber here is useless, since it is an instance of
Koha::Objects.
On the contrary, the following call
    $m->DelModifications;
should have the borrowernumber passed !

So what could we add a sub new to Patron::Modifications like:
+sub new {
+    my ( $class, $params ) = @_;
+    my $self = $class->SUPER::new();
+    $self->{borrowernumber} = $params->{borrowernumber};
+    return $self;
+}
And in opac-memberentry:
+            my $patronmod = Koha::Patron::Modifications->new({ borrowernumber
=> $borrowernumber });
+            $patronmod->DelModifications({ borrowernumber => $borrowernumber
});
+            $patronmod->AddModifications(\%borrower_changes);


But this is a horrible hack. We should not use a Koha::Objects like that..
And what about its unit test:  t/db_dependent/Koha_borrower_modifications.t
Currently fails !

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to