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.
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;