Bugzilla – Attachment 3746 Details for
Bug 6090
empty mails in message_queue are sent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-6090-Empty-mails-in-message_queue-are-sent.patch (text/plain), 3.08 KB, created by
Julian Maurice
on 2011-04-06 13:54:15 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2011-04-06 13:54:15 UTC
Size:
3.08 KB
patch
obsolete
>From ae9cbf7b0ac39a7dbf4a834286b61e16c47a6f90 Mon Sep 17 00:00:00 2001 >From: Sophie Meynieux <sophie.meynieux@biblibre.com> >Date: Mon, 13 Dec 2010 13:00:31 +0100 >Subject: [PATCH] Bug 6090: Empty mails in message_queue are sent > >Add a new script to purge message_queue table. This script should be run before process_message_queue.pl > >BibLibre MT4764 >--- > C4/Letters.pm | 19 ++++++++++- > misc/cronjobs/purge_message_queue.pl | 58 ++++++++++++++++++++++++++++++++++ > 2 files changed, 76 insertions(+), 1 deletions(-) > create mode 100644 misc/cronjobs/purge_message_queue.pl > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 34e3686..a439036 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -42,7 +42,7 @@ BEGIN { > $VERSION = 3.01; > @ISA = qw(Exporter); > @EXPORT = qw( >- &GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts GetPrintMessages >+ &GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts &GetPrintMessages &DelEmptyMessages > ); > } > >@@ -710,6 +710,23 @@ ENDSQL > return $sth->fetchall_arrayref({}); > } > >+ >+=head2 DelEmptyMessages >+ &DelcwEmptyMessages() >+ >+ Delete all messages without subjet nor content >+ >+=cut >+sub DelEmptyMessages { >+ my $dbh = C4::Context->dbh; >+ >+ my $sth = $dbh->prepare(" >+ DELETE FROM message_queue WHERE subject is null and content is null; >+ "); >+ $sth->execute(); >+} >+ >+ > =head2 _add_attachements > > named parameters: >diff --git a/misc/cronjobs/purge_message_queue.pl b/misc/cronjobs/purge_message_queue.pl >new file mode 100644 >index 0000000..9a532da >--- /dev/null >+++ b/misc/cronjobs/purge_message_queue.pl >@@ -0,0 +1,58 @@ >+ >+#!/usr/bin/perl -w >+ >+# Copyright 2010 Biblibre SARL >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use strict; >+use warnings; >+use utf8; >+ >+BEGIN { >+ >+ # find Koha's Perl modules >+ # test carefully before changing this >+ use FindBin; >+ eval { require "$FindBin::Bin/../kohalib.pl" }; >+} >+ >+use Getopt::Long; >+use Pod::Usage; >+use C4::Letters; >+ >+my ($help); >+ >+GetOptions( >+ 'help|?' => \$help >+); >+ >+if($help){ >+ print <<EOF >+ This script delete message without subject nor content. >+ It has to be run before sending messages. >+ Parameters : >+ -help|? This message >+ >+ example : >+ export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha/koha-conf.xml;./purge_message_queue.pl >+EOF >+; >+ exit; >+} >+ >+DelEmptyMessages(); >+ >-- >1.7.4.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 6090
:
3746
|
8085
|
9996
|
10151
|
10377
|
10378
|
10381