[Koha-bugs] [Bug 24001] Cannot edit card template

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Oct 3 09:23:24 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24001

David Nind <david at davidnind.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Failed QA
                 CC|                            |david at davidnind.com

--- Comment #40 from David Nind <david at davidnind.com> ---
Apologies for the rather long comment, and for marking as "Failed QA".

TLDR;
- the patch works, however there is a problem with the printer profile drop
down list - it takes you to the new printer profile page
- you can't create a new printer profile (for both the patron card creator and
the label creator tools) - this should possibly be another bug
- it looks like this hasn't worked for several versions

Before applying the patch
=========================

The card template is not created and you are returned to the list of currently
available templates. These error messages are generated in
/var/log/koha/kohadev/plack-intranet-error.log:

1 [2020/10/03 06:08:27] [WARN] DBD::mysql::st execute failed: Incorrect integer
value: '' for column 'profile_id' at row 1 [for Statem    ent "INSERT INTO
creator_templates (`template_code`, `label_width`, `top_margin`, `col_gap`,
`template_desc`, `row_gap`, `rows`, `pa    ge_width`, `cols`, `label_height`,
`units`, `top_text_margin`, `left_margin`, `left_text_margin`, `profile_id`,
`creator`, `page_hei    ght`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);" with
ParamValues: 0="A DEFAULT TEMPLATE", 1="0", 2="0", 3="0", 4="A Default descr   
iption", 5="0", 6="0", 7="0", 8="0", 9="0", 10="POINT", 11=0, 12="0", 13=0,
14='', 15='Patroncards', 16="0"] at /kohadevbox/koha/C4/   
Creators/Template.pm line 199.
2 [2020/10/03 06:08:27] [WARN] Database returned the following error: Incorrect
integer value: '' for column 'profile_id' at row 1 at    
/kohadevbox/koha/C4/Creators/Template.pm line 201.
3 [2020/10/03 06:08:28] [WARN] CGI::param called in list context from
/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron   
cards-errors.inc line 57, this can lead to vulnerabilities. See the warning in
"Fetching the value or values of a single named param    eter" at
/usr/share/perl5/CGI.pm line 412.

If you try to create a printer profile (New > Printer profile) the printer
profile is not created - you are returned to the list of current available
templates. These error messages are generated in
/var/log/koha/kohadev/plack-intranet-error.log:

4 [2020/10/03 06:10:57] [WARN] DBD::mysql::st execute failed: Incorrect integer
value: '' for column 'template_id' at row 1 [for State    ment "INSERT INTO
printers_profile (creep_vert, offset_horz, units, printer_name, creator,
template_id, offset_vert, paper_bin, cree    p_horz) VALUES
(?,?,?,?,?,?,?,?,?);" with ParamValues: 0="0", 1="0", 2="POINT", 3="ABC",
4='Patroncards', 5='', 6="0", 7="2", 8="0"]     at
/kohadevbox/koha/C4/Creators/Profile.pm line 162.
5 [2020/10/03 06:10:57] [WARN] Database returned the following error on
attempted INSERT: Incorrect integer value: '' for column 'temp    late_id' at
row 1 at /kohadevbox/koha/C4/Creators/Profile.pm line 164.

After applying the patch
========================

After applying the patch and adding a card template the card template is
created, so that fixes that issue!

However, there is this error message in
/var/log/koha/kohadev/plack-intranet-error.log:

[2020/10/03 06:15:59] [WARN] CGI::param called in list context from
/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron   
cards-errors.inc line 57, this can lead to vulnerabilities. See the warning in
"Fetching the value or values of a single named param    eter" at
/usr/share/perl5/CGI.pm line 412.

On the create patron card template page if you click on "Click here to define a
printer profile.", you are taken to the create printer profile screen. I'm not
sure what is expected here, but I expect it should be a drop down list of
printer profiles like for the label creator tool (as per Caroline's comment
#37).

If you try to create a printer profile you get the same behaviour as before the
patch was applied.

Other notes:
- Tested using koha-testing-docker and started with ku.
- Using the label creator tool, you get the same error message when you try to
create a printer profile for the patron card creator.

Error messages for Koha 20.05.x, Koha 19.11.x
=============================================

You get these error messages in Koha 20.05.x, 19.11.x and 19.05.x

Create a patron card template - error message in
/var/log/koha/kohadev/plack-error.log:

7 DBD::mysql::st execute failed: Incorrect integer value: '' for column
'profile_id' at row 1 [for Statement "INSERT INTO creator_templates (`row_gap`,
`units`, `temp    late_code`, `page_height`, `left_text_margin`, `page_width`,
`profile_id`, `top_text_margin`, `creator`, `label_width`, `template_desc`,
`left_margin`, `rows`, `col    s`, `top_margin`, `col_gap`, `label_height`)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);" with ParamValues: 0="0",
1="POINT", 2="A DEFAULT TEMPLATE", 3="0", 4=0, 5=    "0", 6='', 7=0,
8='Patroncards', 9="0", 10="A default description", 11="0", 12="0", 13="0",
14="0", 15="0", 16="0"] at /kohadevbox/koha/C4/Creators/Template.pm line    
199.
8 Database returned the following error: Incorrect integer value: '' for column
'profile_id' at row 1 at /kohadevbox/koha/C4/Creators/Template.pm line 201.
9 CGI::param called in list context from
/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
line 57, this can lead to vulnerabilities. S    ee the warning in "Fetching the
value or values of a single named parameter" at /usr/share/perl5/CGI.pm line
412.

Create a printer profile - error message in
/var/log/koha/kohadev/plack-error.log::

10 DBD::mysql::st execute failed: Incorrect integer value: '' for column
'template_id' at row 1 [for Statement "INSERT INTO printers_profile (creator,
template_id, off    set_horz, units, printer_name, creep_horz, creep_vert,
offset_vert, paper_bin) VALUES (?,?,?,?,?,?,?,?,?);" with ParamValues:
0='Patroncards', 1='', 2="0", 3="POINT    ", 4="ABZ", 5="0", 6="0", 7="0",
8="9"] at /kohadevbox/koha/C4/Creators/Profile.pm line 162.
11 Database returned the following error on attempted INSERT: Incorrect integer
value: '' for column 'template_id' at row 1 at
/kohadevbox/koha/C4/Creators/Profile.pm     line 164.

Create a printer profile for the label creator tool - error message in
/var/log/koha/kohadev/plack-error.log:

12 profile_id is currently undefined. at
/kohadevbox/koha/C4/Creators/Profile.pm line 184.
13 DBD::mysql::st execute failed: Incorrect integer value: '' for column
'template_id' at row 1 [for Statement "INSERT INTO printers_profile (units,
printer_name, temp    late_id, creator, offset_horz, offset_vert, paper_bin,
creep_horz, creep_vert) VALUES (?,?,?,?,?,?,?,?,?);" with ParamValues:
0="POINT", 1="ABZ", 2='', 3='Labels',     4=0, 5=0, 6="1", 7=0, 8=0] at
/kohadevbox/koha/C4/Creators/Profile.pm line 162.
14 Database returned the following error on attempted INSERT: Incorrect integer
value: '' for column 'template_id' at row 1 at
/kohadevbox/koha/C4/Creators/Profile.pm     line 164.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list