Bug 18460

Summary: Remove itemtype-related Serials.t warnings
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Test SuiteAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, julian.maurice, katrin.fischer, kyle, mtj, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14598    
Bug Blocks:    
Attachments: Bug 18460: Fix undefined itemtype warning in Serials.t
Bug 18460: Fix undefined itemtype warning in Serials.t
Bug 18460: Fix undefined itemtype warning in Serials.t

Description Tomás Cohen Arazi 2017-04-19 15:15:39 UTC
To reproduce:
- Run:
  $ prove t/db_dependent/Serials.t
=> FAIL: item-level_itypes set... warning
Comment 1 Tomás Cohen Arazi 2017-04-19 15:20:44 UTC
Created attachment 62391 [details] [review]
Bug 18460: Fix undefined itemtype warning in Serials.t

This patch makes the test create an itemtype, and use it for the created item so there's no warning.

To test:
- Run:
  $ prove t/db_dependent/Serials.t
=> FAIL: item-level_itypes set but no itemtype set... warning raised
- Apply the patch
- Run:
  $ prove t/db_dependent/Serials.t
=> SUCCESS: Tests pass and no warning is raised
- Sign off :-D

https://bugs.koha-community.org/show_bug.cgi?id=18361
Comment 2 Marc Véron 2017-04-19 18:10:46 UTC
Ok, reproduced on minimal install:

prove -v t/db_dependent/Serials.t
(...)
item-level_itypes set but no itemtype set for item (5) at /home/marc/koha/Koha/Schema/Result/Item.pm line 698.
(...)

Does no longer appear with patch applied.
Comment 3 Marc Véron 2017-04-19 18:11:46 UTC
Created attachment 62406 [details] [review]
Bug 18460: Fix undefined itemtype warning in Serials.t

This patch makes the test create an itemtype, and use it for the created item so there's no warning.

To test:
- Run:
  $ prove t/db_dependent/Serials.t
=> FAIL: item-level_itypes set but no itemtype set... warning raised
- Apply the patch
- Run:
  $ prove t/db_dependent/Serials.t
=> SUCCESS: Tests pass and no warning is raised
- Sign off :-D

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

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 4 Jonathan Druart 2017-04-19 18:40:02 UTC
Created attachment 62411 [details] [review]
Bug 18460: Fix undefined itemtype warning in Serials.t

This patch makes the test create an itemtype, and use it for the created item so there's no warning.

To test:
- Run:
  $ prove t/db_dependent/Serials.t
=> FAIL: item-level_itypes set but no itemtype set... warning raised
- Apply the patch
- Run:
  $ prove t/db_dependent/Serials.t
=> SUCCESS: Tests pass and no warning is raised
- Sign off :-D

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Kyle M Hall 2017-04-21 14:31:38 UTC
Pushed to master for 17.05, thanks Tomas!
Comment 6 Katrin Fischer 2017-04-21 22:42:35 UTC
This patch has been pushed to 16.11.x and will be in 16.11.07.
Comment 7 Mason James 2017-05-03 04:40:10 UTC
Pushed to 16.05.x, for 16.05.12 release
Comment 8 Julian Maurice 2017-05-10 09:55:39 UTC
Pushed to 3.22.x for 3.22.21