Bugzilla – Attachment 49005 Details for
Bug 16053
Edit the active currency removes its 'active' flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16053: Do not remove the active flag when editing the active currency
Bug-16053-Do-not-remove-the-active-flag-when-editi.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2016-03-11 11:56:56 UTC
(
hide
)
Description:
Bug 16053: Do not remove the active flag when editing the active currency
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-11 11:56:56 UTC
Size:
1.67 KB
patch
obsolete
>From 500305026f1d1a62009ad7abd655ac6b19bc3e0e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 11 Mar 2016 11:42:09 +0000 >Subject: [PATCH] Bug 16053: Do not remove the active flag when editing the > active currency > >From commit b574b615919a6463708d4c1d7b1153a061c1ea0a > Bug 15084: Make sure the previous active currency is marked as inactive > >When a currency is stored, all the active flags of all currencies are unset. >Only the active ones and different than the one we are editing should be updated. > >Test plan: >Edit the active currency >=> Without this patch the active flag was removed >=> With this patch, the active flag is kept > >Edit another currency and set it the active flag >=> The active flag must have been removed from the previously active >currency. >--- > Koha/Acquisition/Currency.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm >index 63c8693..42d3f19 100644 >--- a/Koha/Acquisition/Currency.pm >+++ b/Koha/Acquisition/Currency.pm >@@ -42,7 +42,13 @@ sub store { > my $result; > $self->_result->result_source->schema->txn_do( sub { > if ( $self->active ) { >- my @currencies = Koha::Acquisition::Currencies->search; >+ # Remove the active flag from all other active currencies >+ my @currencies = Koha::Acquisition::Currencies->search( >+ { >+ currency => { '!=' => $self->currency }, >+ active => 1, >+ } >+ ); > for my $currency ( @currencies ) { > $currency->active(0); > $currency->store; >-- >2.7.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16053
:
49004
|
49005
|
49045
|
49046
|
49340
|
49341