Bug 34359 - Get rid of Koha/BiblioUtils/Iterator
Summary: Get rid of Koha/BiblioUtils/Iterator
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 12478
Blocks:
  Show dependency treegraph
 
Reported: 2023-07-24 14:31 UTC by Marcel de Rooy
Modified: 2023-08-30 09:01 UTC (History)
2 users (show)

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


Attachments
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test (6.51 KB, patch)
2023-07-24 14:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test (6.55 KB, patch)
2023-07-24 17:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test (6.60 KB, patch)
2023-07-30 21:18 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 Marcel de Rooy 2023-07-24 14:31:56 UTC
This is not used (only by itself):

git grep BiblioUtils::Iterator

Koha/BiblioUtils/Iterator.pm:package Koha::BiblioUtils::Iterator;
Koha/BiblioUtils/Iterator.pm:Koha::BiblioUtils::Iterator - iterates over biblios provided by a DBIx::Class::ResultSet
Koha/BiblioUtils/Iterator.pm:  use Koha::BiblioUtils::Iterator;
Koha/BiblioUtils/Iterator.pm:  my $iterator = Koha::BiblioUtils::Iterator->new($rs);
t/db_dependent/Koha/BiblioUtils/Iterator.t:use_ok('Koha::BiblioUtils::Iterator');
t/db_dependent/Koha/BiblioUtils/Iterator.t:my $iterator = Koha::BiblioUtils::Iterator->new($rs, items => 1 );

I know that someone kind of hates Util modules :)

Unfortunately we cannot (yet) remove Koha::BiblioUtils module:

Koha/BiblioUtils.pm:package Koha::BiblioUtils;
Koha/BiblioUtils.pm:Koha::BiblioUtils - contains fundamental biblio-related functions
Koha/BiblioUtils.pm:    my $biblio = Koha::BiblioUtils->new($marc_record, [$biblionumber]);
Koha/BiblioUtils.pm:Creates an instance of C<Koha::BiblioUtils> based on the marc record. If known,
Koha/BiblioUtils.pm:    my $biblio = Koha::BiblioUtils->get_from_biblionumber($biblionumber, %options);
Koha/BiblioUtils.pm:This will give you an instance of L<Koha::BiblioUtils> that is the biblio that
Koha/BiblioUtils.pm:    my $it = Koha::BiblioUtils->get_all_biblios_iterator(%options);
Koha/BiblioUtils.pm:Koha::BiblioUtils of each biblio. This will include the item data.
Koha/BiblioUtils.pm:    my $marc = Koha::BiblioUtils->get_marc_biblio($bibnum, %options);
misc/release_notes/release_notes_22_05_00.html:<li><a href="http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29625">[29625]</a> Wrong var name in Koha::BiblioUtils get_all_biblios_iterator</li>
misc/release_notes/release_notes_22_05_00.md:- [[29625]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29625) Wrong var name in Koha::BiblioUtils get_all_biblios_iterator
misc/search_tools/rebuild_elasticsearch.pl:use Koha::BiblioUtils;
misc/search_tools/rebuild_elasticsearch.pl:            return ($r, Koha::BiblioUtils->get_from_biblionumber($r, item_data => 1 ));
misc/search_tools/rebuild_elasticsearch.pl:        my $records = Koha::BiblioUtils->get_all_biblios_iterator(%iterator_options);
Comment 1 Marcel de Rooy 2023-07-24 14:33:18 UTC
Created attachment 153839 [details] [review]
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test

Test plan:
git grep BiblioUtils::Iterator

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Jonathan Druart 2023-07-24 17:50:02 UTC
This has actually been replaced with Koha::BiblioUtils::get_all_biblios_iterator, since the very beginning (12478).
Comment 3 Jonathan Druart 2023-07-24 17:52:05 UTC
Created attachment 153854 [details] [review]
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test

Test plan:
git grep BiblioUtils::Iterator

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Katrin Fischer 2023-07-30 21:18:11 UTC
Created attachment 154079 [details] [review]
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test

Test plan:
git grep BiblioUtils::Iterator

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2023-08-15 09:14:23 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-08-17 19:31:59 UTC
I propose not to backport to stable