[Koha-bugs] [Bug 27730] New: Innocent changes to framework silently delete bibliographic data

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 19 11:36:19 CET 2021


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

            Bug ID: 27730
           Summary: Innocent changes to framework silently delete
                    bibliographic data
 Change sponsored?: ---
           Product: Koha
           Version: 19.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: Cataloging
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: ian.bays at ptfs-europe.com
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

If you copy and change a framework and either delete a subfield in the new
framework or mark the subfield tab as "ignore", then any bib data with data in
that subfield, when saved in the new framework will be silently destroyed with
no option to undo.

Test Plan to confirm behaviour:

1. Create bib record in default framework with minimal data, but add tag 365
(as it has a number of subfields all visible) and populate subfields a through
h with "fa" through "fh". Save the record and with sql check the contents of
the metadata.

(I found this SQL gives enough information substituting the correct bib number
of the saved record:

select tagfield, tagsubfield, frameworkcode, tab, hidden, (select
ExtractValue(metadata, '//datafield[@tag="365"]/subfield[@code>="a"]') from
biblio_metadata where biblionumber = 37002 and (select frameworkcode from
biblio where biblionumber = 37002) = marc_subfield_structure.frameworkcode) tv
from marc_subfield_structure where frameworkcode in ('', 'TEST') and tagfield =
'365';
)

2. Copy the default framework to a TEST framework and set (say 365$b to tab
ignore and delete 365$d). (I used export the default framework to a csv, create
new TEST framework and import from the saved default csv)

3. Edit the bib record and change framework to TEST framework (settings >
change framework) and save the record.

4. Run the SQL again and observe the data from subfields b and d have both
disappeared from the metadata.

If you were to rerun these tests you may need to reload memcache to ensure the
newly changed frameworks are picked up.

I understand it has been broadly known by some long-term Koha users that
deleting a subfield from the framework has this effect, but both these
situations potentially cause bib data to be silently and permanently delated
from the database.  Many users will be unaware and may not discover the problem
for some time.

Potential solutions might include:

a) For subfields not in the framework or with tab "ignore" allow the data to be
saved as is on saving for edit;

b) When selecting "change framework" detect if data would be lost and alert the
user with an option to back out of the change without losing data;

c) Do not allow deletion of a subfield from a framework and do not allow the
"ignore" option for the tab.  If a field is to be ignored but hidden there are
plenty of visibility options in the framework.

NB: The current delivered default framework has 13 subfields set to the
"ignore" tab.  I cannot see what purpose these serve as no data can survive
within them.

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


More information about the Koha-bugs mailing list