https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19349
--- Comment #5 from Marcel de Rooy <m.de.r...@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. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/