Bugzilla – Attachment 53241 Details for
Bug 16889
Move the ::columns subroutines to Koha::Objects->columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16889: Remove C4::Members::columns and use Koha::Patrons->columns instead
Bug-16889-Remove-C4Memberscolumns-and-use-KohaPatr.patch (text/plain), 3.12 KB, created by
Jonathan Druart
on 2016-07-09 13:54:29 UTC
(
hide
)
Description:
Bug 16889: Remove C4::Members::columns and use Koha::Patrons->columns instead
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-09 13:54:29 UTC
Size:
3.12 KB
patch
obsolete
>From 5fcc809c4dba4a2455f9caac6339d2ec76d395e4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 9 Jul 2016 14:35:08 +0100 >Subject: [PATCH] Bug 16889: Remove C4::Members::columns and use > Koha::Patrons->columns instead > >Test plan: >Import some patrons (tools/import_borrowers.pl) and make sure it imports >the patrons correctly. >--- > C4/Members.pm | 35 ----------------------------------- > t/db_dependent/Members/columns.t | 24 ------------------------ > tools/import_borrowers.pl | 3 ++- > 3 files changed, 2 insertions(+), 60 deletions(-) > delete mode 100644 t/db_dependent/Members/columns.t > >diff --git a/C4/Members.pm b/C4/Members.pm >index f9b3942..94afe40 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -552,41 +552,6 @@ sub GetMemberIssuesAndFines { > } > > >-=head2 columns >- >- my @columns = C4::Member::columns(); >- >-Returns an array of borrowers' table columns on success, >-and an empty array on failure. >- >-=cut >- >-sub columns { >- >- # Pure ANSI SQL goodness. >- my $sql = 'SELECT * FROM borrowers WHERE 1=0;'; >- >- # Get the database handle. >- my $dbh = C4::Context->dbh; >- >- # Run the SQL statement to load STH's readonly properties. >- my $sth = $dbh->prepare($sql); >- my $rv = $sth->execute(); >- >- # This only fails if the table doesn't exist. >- # This will always be called AFTER an install or upgrade, >- # so borrowers will exist! >- my @data; >- if ($sth->{NUM_OF_FIELDS}>0) { >- @data = @{$sth->{NAME}}; >- } >- else { >- @data = (); >- } >- return @data; >-} >- >- > =head2 ModMember > > my $success = ModMember(borrowernumber => $borrowernumber, >diff --git a/t/db_dependent/Members/columns.t b/t/db_dependent/Members/columns.t >deleted file mode 100644 >index 5b7ffe0..0000000 >--- a/t/db_dependent/Members/columns.t >+++ /dev/null >@@ -1,24 +0,0 @@ >-#!/usr/bin/perl >-# >-# This is to test C4/Members >-# It requires a working Koha database with the sample data >- >-use Modern::Perl; >- >-use Test::More tests => 2; >- >-BEGIN { >- use_ok('C4::Members'); >-} >- >-my @borrowers_columns = C4::Members::columns; >-ok( >- $#borrowers_columns > 1, >- 'C4::Member->column returned a reasonable number of columns (' >- . ( $#borrowers_columns + 1 ) . ')' >- ) >- or diag( >-'WARNING: Check that the borrowers table exists and has the correct fields defined.' >- ); >- >-exit; >diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl >index 8c03274..e1754e6 100755 >--- a/tools/import_borrowers.pl >+++ b/tools/import_borrowers.pl >@@ -48,6 +48,7 @@ use C4::Members::Messaging; > use C4::Reports::Guided; > use C4::Templates; > use Koha::Patron::Debarments; >+use Koha::Patrons; > use Koha::DateUtils; > > use Text::CSV; >@@ -61,7 +62,7 @@ use CGI qw ( -utf8 ); > my (@errors, @feedback); > my $extended = C4::Context->preference('ExtendedPatronAttributes'); > my $set_messaging_prefs = C4::Context->preference('EnhancedMessagingPreferences'); >-my @columnkeys = C4::Members::columns(); >+my @columnkeys = Koha::Patrons->columns(); > @columnkeys = map { $_ ne 'borrowernumber' ? $_ : () } @columnkeys; > if ($extended) { > push @columnkeys, 'patron_attributes'; >-- >2.8.1
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 16889
:
53240
|
53241
|
53243
|
53244
|
53292
|
53293
|
53294
|
53295
|
53379
|
53380
|
53381
|
53382
|
53383