Bug 27866 - Cannot create new printer profiles
Summary: Cannot create new printer profiles
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-04 16:26 UTC by Lucas Gass (lukeg)
Modified: 2021-06-04 09:46 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2021-03-04 16:26:57 UTC
to recerate:

-go to Home › Tools › Label creator › Profiles › New printer profile (/cgi-bin/koha/labels/label-edit-profile.pl?op=new)
-attempt to save a new printer profile
-get an error


C4::Creators::Profile::save(): DBI Exception: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1 [for Statement "INSERT INTO printers_profile (printer_name, offset_vert, creep_vert, paper_bin, template_id, creep_horz, units, creator, offset_horz) VALUES (?,?,?,?,?,?,?,?,?);" with ParamValues: 0="e", 1=0, 2=0, 3="e", 4='', 5=0, 6="MM", 7='Labels', 8=0] at /kohadevbox/koha/C4/Labels/Profile.pm line 23
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Comment 1 Katrin Fischer 2021-06-04 09:46:40 UTC
I think the problem might occur when the printer name is left empty. The first time it kinda uses a default value, the second time, things explode:

C4::Creators::Profile::save(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'DEFAULT PRINTER-0-Tray 1-Labels' for key 'printername' [for Statement "INSERT INTO printers_profile (template_id, creep_vert, creator, printer_name, creep_horz, units, offset_horz, paper_bin, offset_vert) VALUES (?,?,?,?,?,?,?,?,?);" with ParamValues: 0='', 1=0, 2='Labels', 3='DEFAULT PRINTER', 4=0, 5="POINT", 6=0, 7='Tray 1', 8=0] at /home/vagrant/kohaclone/C4/Labels/Profile.pm line 23
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

If I enter a printer name, things save ok.

Lucas, could this be it or are you seeing another issue?