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

--- Comment #7 from Lisette Scheer <[email protected]> ---
Created attachment 210971
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210971&action=edit
Bug 44015: Diff the nested fields of added and deleted additional contents

C4::Log diffs an added entry against an empty hashref, and a deleted one
to an empty hashref, so Struct::Diff reports a nested hash as a single
added or removed block. For additional contents, the localizations were
logged as one "contents" block on ADD and DELETE while MODIFY reports each
title and content by language, so the diffs could not be compared.

This patch diffs added and deleted NEWS entries against the skeleton of
their nested hashes, so each nested field is reported as added or removed,
the way modifications nest them. Other modules are unchanged, as the
catalog and authority logs rely on _marc being one block.

To test:
1. Enable AdditionalContentLog
2. Add a news item with a default and a translated title/content, edit it,
   then delete it
3. Go to Tools > Log viewer, select the Additional contents module, show
   the Diff column
4. Confirm the ADD and DELETE diffs list the title and content of each
   language separately, like the MODIFY diff
5. prove t/db_dependent/Log.t t/db_dependent/Koha/AdditionalContents.t \
         t/db_dependent/AuthoritiesMarc.t t/db_dependent/Koha/Biblio.t

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to