Bug 15084: typo currency vs currency_code
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 Mar 2016 10:15:32 +0000 (10:15 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Tue, 8 Mar 2016 22:03:54 +0000 (22:03 +0000)
The DB column is currency.currency not currency.currency_code.

Test plan:
Delete a currency
Without this patch, you will get a warning in the logs:
No method currency_code! at
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
line 148.
And the currency won't be deleted.

With this patch, it will!

It also changes the value of the delete op.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
admin/currency.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt

index 9c8f825..4d791db 100755 (executable)
@@ -98,7 +98,7 @@ if ( $op eq 'add_form' ) {
         currency     => $currency,
         nb_of_orders => $nb_of_orders,
     );
-} elsif ( $op eq 'delete' ) {
+} elsif ( $op eq 'delete_confirmed' ) {
     my $currency = Koha::Acquisition::Currencies->find($currency_code);
     my $deleted = eval { $currency->delete; };
 
index 305e471..8fb7152 100644 (file)
         </table>
         <form action="/cgi-bin/koha/admin/currency.pl" method="post">
             <input type="hidden" name="op" value="delete_confirmed" />
-            <input type="hidden" name="currency_code" value="[% currency.currency_code %]" />
+            <input type="hidden" name="currency_code" value="[% currency.currency %]" />
             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
         </form>
         <form action="/cgi-bin/koha/admin/currency.pl" method="post">