Bug 36758: (follow-up) Fix unit tests
We do two things here.. * We're making the improvement to C4::Letters that sets librarian to a patron object more resilient by testing for the userenv first. * We correct the logic in Koha::Ticket such that we always store changes when there's a ticket update Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
88500ccef4
commit
f55519b505
|
|
@ -626,7 +626,8 @@ sub GetPreparedLetter {
|
|||
return;
|
||||
my $want_librarian = $params{want_librarian};
|
||||
if ($want_librarian) {
|
||||
$objects->{librarian} = Koha::Patrons->find( C4::Context->userenv->{number} );
|
||||
my $userenv = C4::Context->userenv;
|
||||
$objects->{librarian} = Koha::Patrons->find( C4::Context->userenv->{number} ) if ($userenv);
|
||||
}
|
||||
|
||||
# Best guess at language 'default' notice is written for include handling
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@ sub store {
|
|||
}
|
||||
} else {
|
||||
my %updated_columns = $self->_result->get_dirty_columns;
|
||||
return $self->SUPER::store unless %updated_columns;
|
||||
$self->SUPER::store;
|
||||
$self->discard_changes;
|
||||
|
||||
$assignee = ( exists $updated_columns{assignee_id} ) ? $self->assignee : undef;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue