Bug 10828 - Label creator returns empty pdf, xml or csv file
Summary: Label creator returns empty pdf, xml or csv file
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: 3.12
Hardware: All All
: P1 - high enhancement (vote)
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-05 14:25 UTC by Pedro Ferreira
Modified: 2014-12-07 20:03 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
blank pdf file (546 bytes, application/pdf)
2013-09-05 18:48 UTC, Pedro Ferreira
Details
blank pdf file (564 bytes, application/pdf)
2013-09-05 18:54 UTC, Pedro Ferreira
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Ferreira 2013-09-05 14:25:32 UTC
In "LABEL CREATOR" i choose "NEW BATCH" then "ADD ITEM(S)".
In "Search for items to add to Batch ", i can sucessfully search for an item and then i can select it to add to the batch. 

I click the "EXPORT BATCH", and then i select the template and the layout. It is from this point that i detect some problems.

When i choose the "Download as PDF" I always get an empty PDF FILE. No labels are created

In the error log from apache i have the following messages


[Thu Sep 05 15:23:43 2013] [error] [client 213.228.143.2] [Thu Sep  5 15:23:43 2013] label-create-pdf.pl: "my" variable $template masks earlier declaration in same scope at /var/www/koha3.12/intranet/cgi-bin/labels/label-create-pdf.pl line 63., referer: http://catalogobib.cm-portel.pt:82/cgi-bin/koha/labels/label-print.pl

[Thu Sep 05 15:23:43 2013] [error] [client 213.228.143.2] [Thu Sep  5 15:23:43 2013] label-create-pdf.pl: regexp failed to match string:  at /var/www/koha3.12/lib/C4/Labels/Label.pm line 138., referer: http://catalogobib.cm-portel.pt:82/cgi-bin/koha/labels/label-print.pl

[Thu Sep 05 15:23:43 2013] [error] [client 213.228.143.2] [Thu Sep  5 15:23:43 2013] label-create-pdf.pl: Use of uninitialized value $parts[-1] in pattern match (m//) at /var/www/koha3.12/lib/C4/Labels/Label.pm line 160., referer: http://catalogobib.cm-portel.pt:82/cgi-bin/koha/labels/label-print.pl

[Thu Sep 05 15:23:43 2013] [error] [client 213.228.143.2] [Thu Sep  5 15:23:43 2013] label-create-pdf.pl: Use of uninitialized value $parts[-1] in pattern match (m//) at /var/www/koha3.12/lib/C4/Labels/Label.pm line 160., referer: http://catalogobib.cm-portel.pt:82/cgi-bin/koha/labels/label-print.pl

[Thu Sep 05 15:23:43 2013] [error] [client 213.228.143.2] [Thu Sep  5 15:23:43 2013] label-create-pdf.pl: regexp failed to match string:  at /var/www/koha3.12/lib/C4/Labels/Label.pm line 165., referer: http://catalogobib.cm-portel.pt:82/cgi-bin/koha/labels/label-print.pl


I Have KOHA 3.12 and i migrate the Database from version 3.0.6.04
Comment 1 Chris Nighswonger 2013-09-05 14:47:02 UTC
We'll need a little more information to determine if this is a bug or a problem with data corruption during your upgrade.

Please attach the following:

1. A pdf file created from your installation which is "blank."

2. Some marc records with the items used on the "blank" form.
Comment 2 Pedro Ferreira 2013-09-05 18:48:32 UTC Comment hidden (obsolete)
Comment 3 Pedro Ferreira 2013-09-05 18:54:45 UTC
Created attachment 20811 [details]
blank pdf file

Batch file created from this record

http://catalogobib.cm-portel.pt/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=2293


catalogobib.cm-portel.pt is our Municipality public library link
Comment 4 Pedro Ferreira 2013-09-10 16:40:23 UTC
Just made 2 fresh intalls koha-3.12.04
and koha-3.08.16

in koha-3.12.04 the labels are also empty as in version 3.12.02

in koha-3.08.16 i get the same error 


[Tue Sep 10 17:27:42 2013] [error] [client 192.168.20.251] [Tue Sep 10 17:27:42 2013] label-create-pdf.pl: Use of uninitialized value $parts[-1] in pattern match (m//) at /var/www/koha3.08.16/lib/C4/Labels/Label.pm line 160., referer: http://192.168.40.233:86/cgi-bin/koha/labels/label-print.pl
[Tue Sep 10 17:27:42 2013] [error] [client 192.168.20.251] [Tue Sep 10 17:27:42 2013] label-create-pdf.pl: Use of uninitialized value $parts[-1] in pattern match (m//) at /var/www/koha3.08.16/lib/C4/Labels/Label.pm line 160., referer: http://192.168.40.233:86/cgi-bin/koha/labels/label-print.pl
[Tue Sep 10 17:27:42 2013] [error] [client 192.168.20.251] [Tue Sep 10 17:27:42 2013] label-create-pdf.pl: regexp failed to match string:  at /var/www/koha3.08.16/lib/C4/Labels/Label.pm line 165., referer: http://192.168.40.233:86/cgi-bin/koha/labels/label-print.pl


I really dont have a clue what is happening and how to start drilling down the problem
Comment 5 Pedro Ferreira 2013-09-12 08:51:02 UTC
I have reached a solution. i think

What generates the blank data is a file called Label.pm that exists in the koha instalation dir.
For example in my current instalations using the packages available in koha downloads i have

version 3.08.16
/var/www/koha3.08.16/lib/C4/Labels/Label.pm

version 3.12.02
/var/www/koha3.12/lib/C4/Labels/Label.pm

version 3.12.04
/var/www/koha3.12.04/lib/C4/Labels/Label.pm

all of this files dont generate any input.
But when i installed the koha-common from the debian tree (Codename:	squeeze)
i have this file /usr/share/koha/lib/C4/Labels/Label.pm
And if i copy the file to the correct place in version 3.08 and 3.12 everything works and the pdf gets the correct data.
Comment 6 Chris Nighswonger 2013-09-12 16:02:30 UTC
(In reply to Pedro Ferreira from comment #5)
> I have reached a solution. i think

> But when i installed the koha-common from the debian tree (Codename:	squeeze)
> i have this file /usr/share/koha/lib/C4/Labels/Label.pm
> And if i copy the file to the correct place in version 3.08 and 3.12
> everything works and the pdf gets the correct data.

This sounds like a package problem, so I'm adding Robin to the cc list with the hopes that he can comment on it.
Comment 7 Robin Sheat 2013-09-13 02:16:35 UTC
(In reply to Chris Nighswonger from comment #6)
> This sounds like a package problem, so I'm adding Robin to the cc list with
> the hopes that he can comment on it.

I don't think it is related to the packages. Pedro, can you please clarify:

When you say:

> But when i installed the koha-common from the debian tree (Codename:	squeeze) 
> i have this file /usr/share/koha/lib/C4/Labels/Label.pm
> And if i copy the file to the correct place in version 3.08 and 3.12 
> everything works and the pdf gets the correct data.

do you mean that you are taking Label.pm and copying it into /var/www/koha3.12/lib/C4/Labels/Label.pm?

If so, it looks like your 3.12 has a wrong or broken version for some reason, whereas the package has the correct one. Or I'm misreading something.
Comment 8 Robin Sheat 2013-09-13 02:17:50 UTC
Rephrase for clarity:

> do you mean that you are taking Label.pm and copying it into /var/www/koha3.12/lib/C4/Labels/Label.pm?

do you mean that you are taking /usr/share/koha/lib/C4/Labels/Label.pm and copying it into /var/www/koha3.12/lib/C4/Labels/Label.pm?
Comment 9 Pedro Ferreira 2013-09-13 09:28:49 UTC
yes that is correct

$ cp /usr/share/koha/lib/C4/Labels/Label.pm /var/www/koha3.12/lib/C4/Labels/Label.pm
Comment 10 Chris Nighswonger 2014-02-24 15:02:55 UTC
(In reply to Pedro Ferreira from comment #9)
> yes that is correct
> 
> $ cp /usr/share/koha/lib/C4/Labels/Label.pm
> /var/www/koha3.12/lib/C4/Labels/Label.pm

I tend to agree with Robin that this looks like broken non-package installs. I'm closing this as WORKSFORME since it does, indeed, work for me on my dev installs as well as the production installation we run here.