Bugzilla – Attachment 188620 Details for
Bug 38516
Closed group basket not able to open pdf file with adobe The root object is missing or invalid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38516: Use PDF template copy for exporting PDFs
Bug-38516-Use-PDF-template-copy-for-exporting-PDFs.patch (text/plain), 1.88 KB, created by
Arthur Suzuki
on 2025-10-30 08:02:41 UTC
(
hide
)
Description:
Bug 38516: Use PDF template copy for exporting PDFs
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2025-10-30 08:02:41 UTC
Size:
1.88 KB
patch
obsolete
>From f56cfa3d1e3390cbcfe76000cb5087792311e124 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 30 Oct 2025 01:36:53 +0000 >Subject: [PATCH] Bug 38516: Use PDF template copy for exporting PDFs > >Due to a bug in PDF::API2 or related libraries, >you cannot export a PDF if you do not have write >permission on the PDF template. We bypass this >problem by taking a string copy of the PDF template >and working on that instead. > >Test plan: >0. DO NOT APPLY THE PATCH YET >1. chmod 444 /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/pdf/*.pdf >2. Create a basket with a vendor >3. Add an order to the basket >4. Close basket (and attach the basket to a new basket group with the same name) >5. Go to "Closed" tab and click "Export as PDF" >6. Note that you get an error when you try to open it in Adobe or some other PDF program > >7. Apply the patch and restart koha (e.g. koha-plack --restart kohadev) > >8. Try to "Export as PDF" again >9. Note that this time there is no warning and your PDF opens just fine >10. Celebrate! > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >--- > Koha/pdfformat/layout3pages.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/pdfformat/layout3pages.pm b/Koha/pdfformat/layout3pages.pm >index 4edff813c8..d17d230882 100644 >--- a/Koha/pdfformat/layout3pages.pm >+++ b/Koha/pdfformat/layout3pages.pm >@@ -455,7 +455,9 @@ sub printpdf { > # open the default PDF that will be used for base (1st page already filled) > my $pdf_template = > C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout3pages.pdf'; >- my $pdf = PDF::API2->open($pdf_template); >+ my $pdf_template_obj = PDF::API2->open($pdf_template); >+ my $pdf_template_str = $pdf_template_obj->to_string(); >+ my $pdf = PDF::API2->from_string($pdf_template_str); > $pdf->pageLabel( > 0, > { >-- >2.39.5
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 38516
:
174925
|
175288
|
188163
|
188618
|
188620
|
188732
|
188930
|
190005