[Koha] Restore the default Marc Framework

Caroline Cyr La Rose caroline.cyr-la-rose at inlibro.com
Thu Sep 5 01:54:44 NZST 2024


Hi Michael!

The reason why you still see the framework names in the staff interface 
after the DELETE is because the sql commands only remove the marc 
structures, not the actual frameworks. They are in separate tables:

- biblio_framework 
(https://schema.koha-community.org/24_05/tables/biblio_framework.html) 
contains the framework name and description (what you can edit if you 
click on Actions > Edit next to the framework name)

- marc_tag_structure 
(https://schema.koha-community.org/24_05/tables/marc_tag_structure.html) 
contains the MARC fields and labels, and whether they are 
repeatable/mandatory/important (what you can edit when you click Actions 
 > MARC structure, then Actions > Edit tag)

- marc_subfield_structure 
(https://schema.koha-community.org/24_05/tables/marc_subfield_structure.html) 
contains the MARC subfields and labels, whether they are 
repeatable/mandatory/important and all the other information about the 
subfield (what you can edit when you click Actions > MARC structure, 
then Actions > Edit subfield)

As you can see, the DELETE commands only remove the marc_tag_structure 
and marc_subfield_structure, but not biblio_framework.

As for the error message, my best guess is that the ACQ framework is 
created in the installer file you loaded (marc21_framework_DEFAULT.yml), 
and when it tries to create it, it sees that it's already there. 
Fortunately, it didn't seem to stop the whole process (I know SQL INSERT 
commands will stop when they run into an error, but YAML is probably 
different, I'm not sure).

I guess to make absolutely sure you get NO errors, you could also delete 
the biblio_framework entries (DELETE FROM biblio_framework WHERE 
frameworkcode IN ('', 'ACQ')). This way it will recreate everything and 
not run into duplicates.

I'm glad you were able to get the defaults back! I don't know if you saw 
the discussions and bug around framework updates 
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37738)? This 
bug is specifically for getting the MARC21 updates, but I'd love if we 
could have something to "revert" the default framework to its default 
state. Anyway, if you have any input, please comment!

Best regards,

Caroline

P.S. I'd still be curious to know what problems you ran into when trying 
to import the frameworks, it was my (non-tested) suggested workaround to 
get the default back for people who do not have database access. But if 
it doesn't work, that means there is no way to do it other than 
drastically deleting the frameworks...

On 2024-09-03 16:33, Michael Kuhn wrote:
> Hi Caroline
>
> We need to get rid of a corrupt standard framework and load a correct 
> version of it. In the staff client we tried to import correct versions 
> of the framework via Koha menu "Administration > MARC bibliographic 
> frameworks" but it won't import the correct framework (I resign going 
> into details). However I found your message from 1 April 2023 and 
> deleted frameworks '' and 'ACQ' like this:
>
> DELETE FROM marc_subfield_structure WHERE frameworkcode IN ('', 'ACQ');
> DELETE FROM marc_tag_structure WHERE frameworkcode IN ('', 'ACQ');
>
> After doing this I still see the framework codes ('' and 'ACQ') in 
> Koha menu "Administration > MARC bibliographic frameworks". Also in 
> Koha menu "Cataloging > New record" the framework names are still 
> visible - though when clicking them no framework is shown.
>
> So I tried to reload the framewroks using this command ("koha" is the 
> instance name):
>
> $ sudo koha-shell -c "/usr/share/koha/bin/load_yaml.pl --load --file 
> /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml" 
> koha
>
> C4::Installer::load_sql returned the following errors while attempting 
> to load 
> /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml:
> DBD::mysql::db do failed: Duplicate entry 'ACQ' for key 'PRIMARY' at 
> /usr/share/koha/lib/C4/Installer.pm line 577.
>
> After this both frameworks '' (the standard framework) and 'ACQ' seem 
> to be loaded but I'm not sure about the error message.
>
> Do you happen to know what the message is trying to tell me?
>
> Best wishes: Michael


More information about the Koha mailing list