Bug 24001: Fix Card template/rpinter profile creation and edit
authorNick Clemens <nick@bywatersolutions.com>
Fri, 4 Mar 2022 16:19:35 +0000 (16:19 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 28 Apr 2022 20:49:20 +0000 (10:49 -1000)
commitdedc0ae83f945546cbd52d5345f59bc3ecc9f101
tree50912f31445e36f7c179ef7e016255952542642c
parentb3142cfe4363ee163f56076ec9275442f962b077
Bug 24001: Fix Card template/rpinter profile creation and edit

This patch adjusts the template/profiles to use the default of '0'
This should probably be NULL, and the columns foreign keys, this code
could use a further rewrite, but this should fix a long standing bug

To test:
 1 - Using the fresh install, with all the sample data.
 2 - Go to Home › Tools › Patron card creator › Templates
 3 - New > Card template
 4 - Save
 5 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'profile_id' at row 1
 6 - Edit an existing template
 7 - Save
 8 - Error: Can't bless non-reference value at /kohadevbox/koha/C4/Creators/Profile.pm line 89
 9 - Create a new 'Printer profile'
10 - Save
11 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1
12 - Apply the attached patch.
13 - Verify you can create a new 'Card template' and 'Printer profile' with no errors
14 - Verify you can edit and save both of the newly created objects above

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Creators/Profile.pm