Bug 29633 - Unecessary GetMarcBiblio call in Koha::UI::Form::Builder::Item (?)
Summary: Unecessary GetMarcBiblio call in Koha::UI::Form::Builder::Item (?)
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-03 14:21 UTC by Jonathan Druart
Modified: 2023-07-05 12:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-12-03 14:21:25 UTC
Andrew contacted me to raise a potential problem coming from bug 27526:

  commit 7a8357f7099d0863a322d1e91741b792b97fd6e1
  Bug 27526: Adjust code to use Koha::Items

-C4::Biblio::EmbedItemsInMarcBiblio({
-    marc_record  => $temp,
-    biblionumber => $biblionumber });

has been removed.

I have tried to know where the items subfields could be used and found, in Koha/UI/Form/Builder/Item.pm:
1. only if itemcallnumber is used
164             my $temp2 = $marc_record->field($CNtag);

2. cataloguing plugins:
316             record  => $marc_record,

I have not found any cataloguing plugins using the MARC::Record (some are retrieving it when they have been passed in parameter, but that's another story).

So maybe we could:
* Remove marc_record from generate_subfield_form param list
* Fetch it in the itemcallnumber block
* Remove it from the cataloguing plugins
Comment 1 Katrin Fischer 2023-06-25 08:55:11 UTC
It looks like there are only mentions of GetMarcBiblio in comments now - is this still valid?
Comment 2 Jonathan Druart 2023-07-04 14:59:50 UTC
Yes, the suggestion is still valid and can still be implemented.
Comment 3 Marcel de Rooy 2023-07-05 11:14:25 UTC
We now have:
    my $marc_record    = $biblio ? $biblio->metadata->record : undef;

I would be hesitant to remove it. It is not unlikely that a custom cataloguing plugin needs $record for something.
There is no real need to remove it?
Comment 4 Jonathan Druart 2023-07-05 12:20:40 UTC
(In reply to Marcel de Rooy from comment #3)
> We now have:
>     my $marc_record    = $biblio ? $biblio->metadata->record : undef;
> 
> I would be hesitant to remove it. It is not unlikely that a custom
> cataloguing plugin needs $record for something.

As said previously, I didn't find any.

> There is no real need to remove it?

Unnecessary processing?