Bug 22878 - Cannot add a patron card layout with mysql strict mode on
Summary: Cannot add a patron card layout with mysql strict mode on
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17258
  Show dependency treegraph
 
Reported: 2019-05-09 14:49 UTC by Liz Rea
Modified: 2020-06-04 20:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06


Attachments
Bug 22878: Add tests (2.19 KB, patch)
2019-05-10 17:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22878: Do not pass layout_id on creating a layout (1.07 KB, patch)
2019-05-10 17:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22878: Add tests (2.23 KB, patch)
2019-05-11 01:35 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22878: Do not pass layout_id on creating a layout (1.11 KB, patch)
2019-05-11 01:35 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22878: Add tests (2.29 KB, patch)
2019-05-11 10:22 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22878: Do not pass layout_id on creating a layout (1.17 KB, patch)
2019-05-11 10:22 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Liz Rea 2019-05-09 14:49:51 UTC
Attempting to create a patron card layout with mysql strict mode on gives the following error:

DBD::mysql::st execute failed: Incorrect integer value: '' for column 'layout_id' at row 1 [for Statement "INSERT INTO creator_layouts (creator, layout_id, units, layout_xml, layout_name) VALUES (?,?,?,?,?);" with ParamValues: 0='Patroncards', 1="", 2="POINT", 3="<opt guide_box="0" guide_grid="0" page_side="F" units="POINT">
</opt>
", 4="something"] at /kohadevbox/koha/C4/Creators/Layout.pm line 181.
Database returned the following error: Incorrect integer value: '' for column 'layout_id' at row 1 at /kohadevbox/koha/C4/Creators/Layout.pm line 183.
Comment 1 Jonathan Druart 2019-05-10 17:30:08 UTC
Created attachment 89562 [details] [review]
Bug 22878: Add tests
Comment 2 Jonathan Druart 2019-05-10 17:30:11 UTC
Created attachment 89563 [details] [review]
Bug 22878: Do not pass layout_id on creating a layout

Attempting to create a patron card layout with mysql strict mode on gives the following error:
  DBD::mysql::st execute failed: Incorrect integer value: '' for column 'layout_id' at row 1

Test plan:
- Turn on sql_strict_modes
- Create a new patron card
=> Must success with this patch applied
Comment 3 Liz Rea 2019-05-11 01:35:40 UTC
Created attachment 89575 [details] [review]
Bug 22878: Add tests

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 4 Liz Rea 2019-05-11 01:35:50 UTC
Created attachment 89576 [details] [review]
Bug 22878: Do not pass layout_id on creating a layout

Attempting to create a patron card layout with mysql strict mode on gives the following error:
  DBD::mysql::st execute failed: Incorrect integer value: '' for column 'layout_id' at row 1

Test plan:
- Turn on sql_strict_modes
- Create a new patron card
=> Must success with this patch applied

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 5 Katrin Fischer 2019-05-11 10:22:23 UTC
Created attachment 89594 [details] [review]
Bug 22878: Add tests

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2019-05-11 10:22:27 UTC
Created attachment 89595 [details] [review]
Bug 22878: Do not pass layout_id on creating a layout

Attempting to create a patron card layout with mysql strict mode on gives the following error:
  DBD::mysql::st execute failed: Incorrect integer value: '' for column 'layout_id' at row 1

Test plan:
- Turn on sql_strict_modes
- Create a new patron card
=> Must success with this patch applied

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Nick Clemens 2019-05-15 12:17:42 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-05-30 07:12:11 UTC
Pushed to 18.11.x for 18.11.06
Comment 9 Liz Rea 2019-07-02 16:20:47 UTC
Pushed to 18.05 for 18.05.14