https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31109 --- Comment #27 from David Cook <dcook@prosentient.com.au> --- (In reply to Janusz Kaczmarek from comment #18)
(In reply to David Cook from comment #16)
Also, why create Koha::Util::Misc when you could just use Digest::MD5 on the MARCXML representation of the record returned by $biblio->metadata?
Thanks for your comments, David.
First off all, to save time. The proposed solution is time efficient, and generating MARCXML costs time (like 12 times more than the proposed approach).
Except that you're fetching the MARCXML from the database already, so you don't need to generate it ;). Instead of '$orig_rec = $biblio->metadata->record' you'd have $orig_rec = $biblio->metadata->metadata' Theoretically, your approach should actually take longer than using the MARCXML as fetched from the DB, as it's fetching the MARCXML then turning it into a MARC::Record object, and then turning it into a binary format. That's a lot of extra steps, which aren't really necessary.
Secondly, to have a general digest procedure, not only for MARC records, but for all types of objects. (It works fine also for Koha::Object objects, like Koha::Patron, Koha::Item, etc.).
That sounds a bit like premature optimization to me.
Also, I couldn't find an existing module suitable to house the digest function. Hence the Koha::Util::Misc.
I thought we had a bit of a prohibition against "Util" and "Misc" in the coding guidelines but apparently not. I think it might be a bit of an unspoken rule, which keeps getting broken heh. -- You are receiving this mail because: You are watching all bug changes.