projects
/
koha_fer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 6557 follow-up DBRev number
[koha_fer]
/
C4
/
Letters.pm
diff --git
a/C4/Letters.pm
b/C4/Letters.pm
index
89213fe
..
4bde166
100644
(file)
--- a/
C4/Letters.pm
+++ b/
C4/Letters.pm
@@
-38,7
+38,7
@@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
BEGIN {
require Exporter;
# set the version for version checking
BEGIN {
require Exporter;
# set the version for version checking
-
$VERSION = 3.01
;
+
$VERSION = 3.07.00.049
;
@ISA = qw(Exporter);
@EXPORT = qw(
&GetLetters &GetPreparedLetter &GetWrappedLetter &addalert &getalert &delalert &findrelatedto &SendAlerts &GetPrintMessages
@ISA = qw(Exporter);
@EXPORT = qw(
&GetLetters &GetPreparedLetter &GetWrappedLetter &addalert &getalert &delalert &findrelatedto &SendAlerts &GetPrintMessages
@@
-661,7
+661,7
@@
places a letter in the message_queue database table, which will
eventually get processed (sent) by the process_message_queue.pl
cronjob when it calls SendQueuedMessages.
eventually get processed (sent) by the process_message_queue.pl
cronjob when it calls SendQueuedMessages.
-return
true
on success
+return
message_id
on success
=cut
=cut
@@
-672,6
+672,13
@@
sub EnqueueLetter ($) {
return unless exists $params->{'borrowernumber'};
return unless exists $params->{'message_transport_type'};
return unless exists $params->{'borrowernumber'};
return unless exists $params->{'message_transport_type'};
+ my $content = $params->{letter}->{content};
+ $content =~ s/\s+//g if(defined $content);
+ if ( not defined $content or $content eq '' ) {
+ warn "Trying to add an empty message to the message queue" if $debug;
+ return;
+ }
+
# If we have any attachments we should encode then into the body.
if ( $params->{'attachments'} ) {
$params->{'letter'} = _add_attachments(
# If we have any attachments we should encode then into the body.
if ( $params->{'attachments'} ) {
$params->{'letter'} = _add_attachments(
@@
-703,7
+710,7
@@
ENDSQL
$params->{'from_address'}, # from_address
$params->{'letter'}->{'content-type'}, # content_type
);
$params->{'from_address'}, # from_address
$params->{'letter'}->{'content-type'}, # content_type
);
- return $
result
;
+ return $
dbh->last_insert_id(undef,undef,'message_queue', undef)
;
}
=head2 SendQueuedMessages ([$hashref])
}
=head2 SendQueuedMessages ([$hashref])