Summary: | GetMarcSubfieldStructure called with "unsafe" in tests | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrewfh, joonas.kylmala, martin.renvoize, tomascohen, victor |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00, 20.05.07
|
|
Bug Depends on: | 23807 | ||
Bug Blocks: | |||
Attachments: |
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests |
Description
Jonathan Druart
2020-11-13 08:32:25 UTC
Created attachment 113585 [details] [review] Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests It does not feel correct to call GetMarcSubfieldStructure with the unsafe flag set in tests: my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } ); Some tests are failing is run twice Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. [x~10] Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. # Failed test 'Value is mapped correctly for column biblionumber' # at t/db_dependent/Koha/Item.t line 115. # got: undef # expected: '483' [etc.] Test plan: Run the tests twice, without the patch it fails, with the patch it passes Created attachment 113587 [details] [review] Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests It does not feel correct to call GetMarcSubfieldStructure with the unsafe flag set in tests: my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } ); Some tests are failing is run twice Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. [x~10] Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. # Failed test 'Value is mapped correctly for column biblionumber' # at t/db_dependent/Koha/Item.t line 115. # got: undef # expected: '483' [etc.] Test plan: Run the tests twice, without the patch it fails, with the patch it passes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> I dug into the code and agree with this change.. tests well.. Signing off I never went back to this, sorry. The idea was that eventually the caller would fetch the mss data, accumulate it as needed, and pass the right one to the method as a parameter. The context is you will iterate on the biblio's items and it doesn't make sense to retrieve the whole thing. I promise I'll be back to this on this new cycle. I agree with the change BTW. *** Bug 26972 has been marked as a duplicate of this bug. *** Pushed to master for 20.11, thanks to everybody involved! Pushed to 20.05.x for 20.05.07 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |