Bugzilla – Attachment 157017 Details for
Bug 33537
Move domain limits from koha-conf to staff SMTP configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33537: Add better named table_exists alias in Installer module
Bug-33537-Add-better-named-tableexists-alias-in-In.patch (text/plain), 3.58 KB, created by
Marcel de Rooy
on 2023-10-13 07:30:34 UTC
(
hide
)
Description:
Bug 33537: Add better named table_exists alias in Installer module
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-13 07:30:34 UTC
Size:
3.58 KB
patch
obsolete
>From 76ea2862a482cc91f7c26c706568135c0da4a2d4 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 28 Jun 2023 12:07:46 +0000 >Subject: [PATCH] Bug 33537: Add better named table_exists alias in Installer > module >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run dbrev later. It is using table_exists. >Run t/db_dependent/Installer.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > C4/Installer.pm | 8 ++++++-- > t/db_dependent/Installer.t | 16 +++++++++++----- > 2 files changed, 17 insertions(+), 7 deletions(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 7e248a17aa..1a2d93e82c 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -34,7 +34,7 @@ use vars qw(@ISA @EXPORT); > BEGIN { > require Exporter; > @ISA = qw( Exporter ); >- push @EXPORT, qw( primary_key_exists unique_key_exists foreign_key_exists index_exists column_exists TableExists marc_framework_sql_list TransformToNum CheckVersion NewVersion SetVersion sanitize_zero_date update get_db_entries get_atomic_updates run_atomic_updates has_non_dynamic_row_format ); >+ push @EXPORT, qw( primary_key_exists unique_key_exists foreign_key_exists index_exists column_exists TableExists table_exists marc_framework_sql_list TransformToNum CheckVersion NewVersion SetVersion sanitize_zero_date update get_db_entries get_atomic_updates run_atomic_updates has_non_dynamic_row_format ); > }; > > =head1 NAME >@@ -686,7 +686,7 @@ sub column_exists { > return $exists; > } > >-sub TableExists { # Could be renamed table_exists for consistency >+sub TableExists { # Legacy name > my $table = shift; > eval { > my $dbh = C4::Context->dbh; >@@ -698,6 +698,10 @@ sub TableExists { # Could be renamed table_exists for consistency > return 0; > } > >+sub table_exists { # More consistently named alias for TableExists >+ return TableExists(@_); >+} >+ > sub version_from_file { > my $file = shift; > return unless $file =~ m|(^\|/)(\d{2})(\d{2})(\d{2})(\d{3}).pl$|; >diff --git a/t/db_dependent/Installer.t b/t/db_dependent/Installer.t >index 2e9c0e26c8..5f21b10822 100755 >--- a/t/db_dependent/Installer.t >+++ b/t/db_dependent/Installer.t >@@ -18,18 +18,18 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-# This Koha test module is still a stub! >-# Add more tests here!!! >- > use Modern::Perl; >-use Test::More tests => 22; >+use Test::More tests => 23; > use File::Temp qw(tempfile); > use utf8; > > use Koha::Database; > > BEGIN { >- use_ok('C4::Installer', qw( column_exists index_exists unique_key_exists foreign_key_exists primary_key_exists marc_framework_sql_list )); >+ use_ok( >+ 'C4::Installer', >+ qw( column_exists index_exists unique_key_exists foreign_key_exists primary_key_exists marc_framework_sql_list table_exists ) >+ ); > } > > ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' ); >@@ -77,6 +77,12 @@ ok( primary_key_exists( 'borrowers' ), 'Borrowers does have a primary key on som > ok( primary_key_exists( 'borrowers', 'borrowernumber'), 'Borrowers has primary key on borrowernumber'); > ok( ! primary_key_exists( 'borrowers', 'email'), 'Borrowers does not have a primary key on email'); > >+subtest 'table_exists' => sub { >+ plan tests => 2; >+ is( table_exists( 'borrowers' ), 1, 'Table borrowers still exists ;)' ); >+ is( table_exists( 'this_table_will_never_exist' ), 0, 'This table does not exist, not likely to be created too' ); >+}; >+ > subtest 'marc_framework_sql_list' => sub { > plan tests => 1; > >-- >2.30.2
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 33537
:
153351
|
153352
|
153353
|
153354
|
153355
|
153356
|
153357
|
153358
|
153359
|
153361
|
153362
|
153363
|
153364
|
154769
|
154770
|
154771
|
154772
|
154773
|
154774
|
154775
|
154776
|
154777
|
154778
|
154779
|
154818
|
154819
|
154820
|
154821
|
154822
|
154823
|
154824
|
154825
|
154826
|
154827
|
154828
|
154829
|
154830
|
154831
|
154832
|
154833
|
154869
|
154870
|
154871
|
154872
|
154873
|
157017
|
157018
|
157019
|
157020
|
157021
|
157022
|
157023
|
157024
|
157025
|
157026
|
157027
|
157028
|
157029
|
157030
|
157031
|
157032
|
157038
|
157039
|
157040
|
157041
|
157042
|
157043
|
157044
|
157045
|
157046
|
157047
|
157048