[Koha-bugs] [Bug 19349] Allow to store biblio record' s creator and last modifier in MARC

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Oct 23 15:16:57 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19349

--- Comment #5 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Julian, just a few preliminary comments:

-    # FIXME To replace with ->find_or_create?
-    if ( my $m_rs = Koha::Biblio::Metadatas->find($metadata) ) {
-        $m_rs->metadata( $record->as_xml_record($encoding) );
-        $m_rs->store;
-    } else {
-        my $m_rs = Koha::Biblio::Metadata->new($metadata);
-        $m_rs->metadata( $record->as_xml_record($encoding) );
-        $m_rs->store;
+
+    my $m_rs = Koha::Biblio::Metadatas->find($metadata);
+    unless ($m_rs) {
+        $m_rs = Koha::Biblio::Metadata->new($metadata);
+    }
Why did you not apply what is in the FIXME ?

You add a new sub in C4/Biblio for MARC manipulation. Actually something like
create or update. Should we not be looking now how to do such things in the
Koha namespace instead of extending C4?

You add four prefs. Would it be handy to combine them. And test on its value
before saving?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list