Summary: | Bad template in patron card creator can cause server issues | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Label/patron card printing | Assignee: | Chris Nighswonger <cnighswonger> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | christian.stelzenmueller, wizzyrea |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31259 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Patron card layout
Patron card template |
Description
Katrin Fischer
2018-07-19 15:30:03 UTC
Created attachment 77137 [details]
Patron card layout
Created attachment 77138 [details]
Patron card template
We are aware that the values make no sense - it's what you get when you save without changing anything on the form. The form doesn't require any fields, so that could happen by accident.
(In reply to Katrin Fischer from comment #1) > Created attachment 77137 [details] > Patron card layout It would be helpful to have the output of the following SELECT: SELECT * FROM creator_layouts WHERE layout_id = <your id>\G (In reply to Katrin Fischer from comment #2) > Created attachment 77138 [details] > Patron card template > > We are aware that the values make no sense - it's what you get when you save > without changing anything on the form. The form doesn't require any fields, > so that could happen by accident. Likewise, the out put of: SELECT * FROM creator_templates WHERE template_id = <your id>\G Hi Chris, was not sure how to report best, so I have created INSERTS of the data with workbench: INSERT INTO `creator_layouts` (`layout_id`,`barcode_type`,`start_label`,`printing_type`,`layout_name`,`guidebox`,`oblique_title`,`font`,`font_size`,`units`,`callnum_split`,`text_justify`,`format_string`,`layout_xml`,`creator`) VALUES (20,'CODE39',1,'BAR','Testlayout',0,1,'TR',10,'POINT',0,'L','barcode','<opt page_side=\"F\" units=\"POINT\">\n <images name=\"image_1\" Dx=\"72\" Ox=\"0\" Oy=\"0\" Sx=\"0\" Sy=\"0\" Tx=\"4.5\" Ty=\"63\">\n <data_source image_name=\"none\" image_source=\"patronimages\" />\n </images>\n <text><firstname> <surname></text>\n <text enable=\"1\" font=\"TR\" font_size=\"10\" llx=\"100\" lly=\"100\" text_alignment=\"L\" />\n <text>Bibliothek: <branchcode></text>\n <text enable=\"1\" font=\"TR\" font_size=\"10\" llx=\"100\" lly=\"75\" text_alignment=\"L\" />\n <text>Ablaufdatum: 31.06.2014</text>\n <text font=\"TR\" font_size=\"6\" llx=\"115\" lly=\"65\" text_alignment=\"L\" />\n</opt>\n','Patroncards'); INSERT INTO `creator_templates` (`template_id`,`profile_id`,`template_code`,`template_desc`,`page_width`,`page_height`,`label_width`,`label_height`,`top_text_margin`,`left_text_margin`,`top_margin`,`left_margin`,`cols`,`rows`,`col_gap`,`row_gap`,`units`,`creator`) VALUES (24,0,'Testtemplate1','Default description',0,0,0,0,0,0,0,0,0,0,0,0,'POINT','Patroncards'); patronimages are activated. The INSERTS are great, and they represent the quickest way to duplicate a setup for testing. I'll work on this over the next few weeks unless someone gets to it before me. Thx! We haven't been able yet to narrow it down more, but it's a little scary. So would be nice to figure out what happens there. This may be related to the line wrapping code? i.e. we get into a templated situation where we get into the while(1) loop and never get out. More recently lately we've seen the following in our logs when these fail (also this generates gigs and gigs of logs! It's terrible!) [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in quotemeta at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 269. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in quotemeta at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 269. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in concatenation (.) or string at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 267. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in concatenation (.) or string at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 267. Hope this helps some, Liz (In reply to Liz Rea from comment #9) > This may be related to the line wrapping code? i.e. we get into a templated > situation where we get into the while(1) loop and never get out. More > recently lately we've seen the following in our logs when these fail (also > this generates gigs and gigs of logs! It's terrible!) See my comment here: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31259#c6 The root problem may be the same. An immediate solution would be to add a conditioned break to the loop that trips when the loop count exceeds the total length of the line being wrapped. That at least should prevent infinite looping. |