https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24001 --- Comment #10 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Jonathan Druart from comment #9)
edit-template, sorry!
So basically, /cgi-bin/koha/patroncards/edit-template.pl?op=new displays: https://snipboard.io/HCSgBE.jpg
See the "Click here to define a printer profile", even if printer profiles exist (this is IMO a bug).
I tend to agree.
Then save => It's not saved and we get the SQL error.
Given the code you pointed it to me, a profile is created if none is passed. Are we expecting it to be created with a profile_id=0? What on the second template we will add? We created another profile_id=0?
No. When a new template is created with no profile_id passed along, the profile_id is set to 0: http://tinyurl.com/smoh5g6 Ah ha! Here is the offending line: http://tinyurl.com/qurdjnc It should be thus: my @params = ( profile_id => scalar $cgi->param('profile_id') || 0, Only we need to be sure that the value of profile_id is truly numeric and not just null. Perhaps it may need to be quoted. Field constraints disallow null values and '' is just that, of course. -- You are receiving this mail because: You are watching all bug changes.