[Koha-bugs] [Bug 16960] New: Patron::Modifications should be fixed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 22 13:43:33 CEST 2016


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: koha-bugs at lists.koha-community.org
          Reporter: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com, kyle.m.hall at gmail.com

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.


More information about the Koha-bugs mailing list