[Bug 37870] New: t/db_dependent/Koha/UI/Form/Builder/Biblio.t and Item.t
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Bug ID: 37870 Summary: t/db_dependent/Koha/UI/Form/Builder/Biblio.t and Item.t Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Keywords: RM_priority Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org Jenkins is failing on: t/db_dependent/Koha/UI/Form/Builder D10 #1626 D12 #3027 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Tests passing in ktd for me locally, but haven't tried with specific OS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32710 Blocks| |25551 CC| |jonathan.druart@gmail.com --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- More info on bug 32710. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25551 [Bug 25551] [OMNIBUS] Some tests are failing randomly https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32710 [Bug 32710] UI/Form/Builder/Item.t is failing randomly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|t/db_dependent/Koha/UI/Form |UI/Form/Builder/Item.t and |/Builder/Biblio.t and |Biblio.t are still failing |Item.t |randomly (cn_source sort) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171242 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171242&action=edit Bug 37870: Remove warning if biblionumber is not passed Not directly related to the failure, only a bit of cleaning before starting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171243 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171243&action=edit Bug 37870: Fix sort order of class sources There are several things going on here. The tests are failing randomly when some additional class sources are in the DB. This should never happen on Jenkins, but it happened, see the third patch of this patch set (spoiler: tests not run within a txn) There were also a sorting problem: by default sort will show uppercases first: A, B, C, a, b, c However we want: a, A, b, B, c, C which is what fc does (https://perldoc.perl.org/functions/fc) Test plan: 0. Checkout the main branch, without patches from this patchset. 1. Run t/db_dependent/ClassSources.t several times => Notice that new entries in the DB table 'class_sources' are created 2. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t => They fail (if not, run t/db_dependent/ClassSources.t again) 3. Apply the patches 4. Run t/db_dependent/ClassSources.t => No more additional entries in DB, tests are correctly run within transactions 5. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t several times => They always pass Note that the sort should actually be done on the description, not the code. But that's for another bug... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171244&action=edit Bug 37870: Run tests from ClassSources.t within transactions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171242|0 |1 is obsolete| | --- Comment #6 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Created attachment 171283 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171283&action=edit Bug 37870: Remove warning if biblionumber is not passed Not directly related to the failure, only a bit of cleaning before starting. Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171243|0 |1 is obsolete| | --- Comment #7 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Created attachment 171284 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171284&action=edit Bug 37870: Fix sort order of class sources There are several things going on here. The tests are failing randomly when some additional class sources are in the DB. This should never happen on Jenkins, but it happened, see the third patch of this patch set (spoiler: tests not run within a txn) There were also a sorting problem: by default sort will show uppercases first: A, B, C, a, b, c However we want: a, A, b, B, c, C which is what fc does (https://perldoc.perl.org/functions/fc) Test plan: 0. Checkout the main branch, without patches from this patchset. 1. Run t/db_dependent/ClassSources.t several times => Notice that new entries in the DB table 'class_sources' are created 2. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t => They fail (if not, run t/db_dependent/ClassSources.t again) 3. Apply the patches 4. Run t/db_dependent/ClassSources.t => No more additional entries in DB, tests are correctly run within transactions 5. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t several times => They always pass Note that the sort should actually be done on the description, not the code. But that's for another bug... Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171244|0 |1 is obsolete| | --- Comment #8 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Created attachment 171285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171285&action=edit Bug 37870: Run tests from ClassSources.t within transactions Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 CJ Lynce <cj.lynce@westlakelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cj.lynce@westlakelibrary.or | |g Status|Needs Signoff |Signed Off --- Comment #9 from CJ Lynce <cj.lynce@westlakelibrary.org> --- Everything worked as described! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171283|0 |1 is obsolete| | Attachment #171284|0 |1 is obsolete| | Attachment #171285|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171307 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171307&action=edit Bug 37870: Remove warning if biblionumber is not passed Not directly related to the failure, only a bit of cleaning before starting. Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171308 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171308&action=edit Bug 37870: Fix sort order of class sources There are several things going on here. The tests are failing randomly when some additional class sources are in the DB. This should never happen on Jenkins, but it happened, see the third patch of this patch set (spoiler: tests not run within a txn) There were also a sorting problem: by default sort will show uppercases first: A, B, C, a, b, c However we want: a, A, b, B, c, C which is what fc does (https://perldoc.perl.org/functions/fc) Test plan: 0. Checkout the main branch, without patches from this patchset. 1. Run t/db_dependent/ClassSources.t several times => Notice that new entries in the DB table 'class_sources' are created 2. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t => They fail (if not, run t/db_dependent/ClassSources.t again) 3. Apply the patches 4. Run t/db_dependent/ClassSources.t => No more additional entries in DB, tests are correctly run within transactions 5. Run t/db_dependent/Koha/UI/Form/Builder/Biblio.t and t/db_dependent/Koha/UI/Form/Builder/Item.t several times => They always pass Note that the sort should actually be done on the description, not the code. But that's for another bug... Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171309 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171309&action=edit Bug 37870: Run tests from ClassSources.t within transactions Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171310 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171310&action=edit Bug 37870: Tidy Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |januszop@gmail.com --- Comment #15 from Janusz Kaczmarek <januszop@gmail.com> --- *** Bug 37867 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- I see it is in 24.05.x Not needed for backport ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39462 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39462 [Bug 39462] (bug 37870 follow-up) Default values from framework are inserted into existing record while editing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nugged@gmail.com --- Comment #17 from Andrii Nugged <nugged@gmail.com> --- commit: "Bug 37870: Remove warning if biblionumber is not passed" has: ``` if ( exists $self->{biblionumber} ) { $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; ``` why `exists`, instead of `defined`? it is called from cataloguing/addbiblio.pl: my $biblio_form_builder = Koha::UI::Form::Builder::Biblio->new( { biblionumber => scalar $input->param('biblionumber'), } ); so on adding new biblio it produces warning: [2025/05/25 05:11:02] [WARN] Use of uninitialized value in substitution (s///) at /usr/share/koha/lib/Koha/UI/Form/Builder/Biblio.pm line 55. from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:277 from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:888 PAGE GENERATED 200: GET: /intranet/cataloguing/addbiblio.pl?frameworkcode=FA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Andrii Nugged from comment #17)
commit: "Bug 37870: Remove warning if biblionumber is not passed" has:
``` if ( exists $self->{biblionumber} ) { $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; ```
why `exists`, instead of `defined`? it is called from cataloguing/addbiblio.pl:
my $biblio_form_builder = Koha::UI::Form::Builder::Biblio->new( { biblionumber => scalar $input->param('biblionumber'), } );
so on adding new biblio it produces warning:
[2025/05/25 05:11:02] [WARN] Use of uninitialized value in substitution (s///) at /usr/share/koha/lib/Koha/UI/Form/Builder/Biblio.pm line 55. from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:277 from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:888 PAGE GENERATED 200: GET: /intranet/cataloguing/addbiblio.pl?frameworkcode=FA
Well, the main problem I'd say is that $self->{biblionumber} actually never exists! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #18)
(In reply to Andrii Nugged from comment #17)
commit: "Bug 37870: Remove warning if biblionumber is not passed" has:
``` if ( exists $self->{biblionumber} ) { $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; ```
why `exists`, instead of `defined`? it is called from cataloguing/addbiblio.pl:
my $biblio_form_builder = Koha::UI::Form::Builder::Biblio->new( { biblionumber => scalar $input->param('biblionumber'), } );
so on adding new biblio it produces warning:
[2025/05/25 05:11:02] [WARN] Use of uninitialized value in substitution (s///) at /usr/share/koha/lib/Koha/UI/Form/Builder/Biblio.pm line 55. from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:277 from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:888 PAGE GENERATED 200: GET: /intranet/cataloguing/addbiblio.pl?frameworkcode=FA
Well, the main problem I'd say is that $self->{biblionumber} actually never exists!
Sorry forget that, we have a follow-up in main (replacing "$self" with "$params") Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40003 --- Comment #20 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Andrii Nugged from comment #17)
commit: "Bug 37870: Remove warning if biblionumber is not passed" has:
``` if ( exists $self->{biblionumber} ) { $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; ```
why `exists`, instead of `defined`? it is called from cataloguing/addbiblio.pl:
my $biblio_form_builder = Koha::UI::Form::Builder::Biblio->new( { biblionumber => scalar $input->param('biblionumber'), } );
so on adding new biblio it produces warning:
[2025/05/25 05:11:02] [WARN] Use of uninitialized value in substitution (s///) at /usr/share/koha/lib/Koha/UI/Form/Builder/Biblio.pm line 55. from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:277 from /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl:888 PAGE GENERATED 200: GET: /intranet/cataloguing/addbiblio.pl?frameworkcode=FA
Opened bug 40003 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40003 [Bug 40003] Warning generated when creating a new bib record -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|40003 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40003 [Bug 40003] Warning generated when creating a new bib record -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37870 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40003 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40003 [Bug 40003] Warning generated when creating a new bib record -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org