Bugzilla – Attachment 153458 Details for
Bug 33871
Add where parameter to sitemap.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33871: Add try catch in case where parameter is not valid SQL
Bug-33871-Add-try-catch-in-case-where-parameter-is.patch (text/plain), 1.77 KB, created by
Pedro Amorim
on 2023-07-14 10:36:20 UTC
(
hide
)
Description:
Bug 33871: Add try catch in case where parameter is not valid SQL
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-07-14 10:36:20 UTC
Size:
1.77 KB
patch
obsolete
>From 29a4127eb66fca3163429c9668836a25aa39f684 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 14 Jul 2023 10:35:06 +0000 >Subject: [PATCH] Bug 33871: Add try catch in case where parameter is not valid > SQL > >Hi Marcel is this try catch a good idea or irrelevant and unecessary? > >Also, shoul we keep at least 1 test for ->run() (without params) in Sitemapper.t? >The where param in Sitemapper->run is optional, I think should still test for ->run() >--- > Koha/Sitemapper.pm | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > >diff --git a/Koha/Sitemapper.pm b/Koha/Sitemapper.pm >index 6c2520781d..a800a10614 100644 >--- a/Koha/Sitemapper.pm >+++ b/Koha/Sitemapper.pm >@@ -19,6 +19,7 @@ package Koha::Sitemapper; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use Try::Tiny; > use Moo; > > use Koha::Biblios; >@@ -57,13 +58,20 @@ sub run { > say "Creation of Sitemap files in '" . $self->dir . "' directory" > if $self->verbose; > >- $self->writer( Koha::Sitemapper::Writer->new( sitemapper => $self ) ); >- my $rs = Koha::Biblios->search( $filter, { columns => [ qw/biblionumber timestamp/ ] }); >+ try { >+ $self->writer( Koha::Sitemapper::Writer->new( sitemapper => $self ) ); >+ my $rs = Koha::Biblios->search( $filter, { columns => [ qw/biblionumber timestamp/ ] }); > >- while ( $self->process($rs) ) { >- say "..... ", $self->count >- if $self->verbose && $self->count % 10000 == 0; >+ while ( $self->process($rs) ) { >+ say "..... ", $self->count >+ if $self->verbose && $self->count % 10000 == 0; >+ } > } >+ catch { >+ if ( $_->isa('DBIx::Class::Exception') ) { >+ warn $_->{msg}; >+ } >+ }; > } > > >-- >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 33871
:
151879
|
151880
|
153458
|
153534
|
153535
|
155107
|
155108