Bug 5182 - Attempting to export a patron card with no text causes an error to be thrown
Can't use an undefined value as an ARRAY reference at /home/koha/koha.prod/C4/Patroncards/Patroncard.pm line 86. This is caused by testing for text at line 87 rather than line 85. This patch moves the test to line 85.
This commit is contained in:
parent
e58961f689
commit
fe99800a2e
|
|
@ -83,8 +83,8 @@ sub draw_text {
|
|||
my ($self, $pdf, %params) = @_;
|
||||
warn sprintf('No pdf object passed in.') and return -1 if !$pdf;
|
||||
my @card_text = ();
|
||||
return unless (ref($self->{'layout'}->{'text'}) eq 'ARRAY'); # just in case there is not text
|
||||
my $text = [@{$self->{'layout'}->{'text'}}]; # make a copy of the arrayref *not* simply a pointer
|
||||
return unless (ref($text) eq 'ARRAY'); # just in case there is not text
|
||||
while (scalar @$text) {
|
||||
my $line = shift @$text;
|
||||
my $parse_line = $line;
|
||||
|
|
|
|||
Loading…
Reference in New Issue