This post is a follow up to an earlier one on the matter of uploading the Library of Congress’ open-access subject authority file into Koha.
Having completed a full upload of the Library Of Congress’ newly open-access authorities data set (2014 release), users might experience a related error in the OPAC. This post will address this error and provide steps on how to fix it.
- Koha 18.11.05.000
- Linux Ubuntu 16.04.6 LTS
- Mysql Ver 15.1 Distrib 10.0.38-MariaDB
- Apache 2.4.xx
Internal Server Error
After uploading your authority records and re-indexing Zebra, navigate to your OPAC and select the Authority Browser, which can be enabled from the Administration tab in the Koha staff client. (Select ‘Allow’ in the
OpacAuthorities option.) This will create a new tab on your OPAC’s homepage.
In my case, Zebra indexed all 3200 free-floating subdivisions at the beginning of the authority file, so they were pretty easy to identify. Click the ‘Details’ button on one of your subdivision records to see the specific MARC data associated with the record. Instead of the expected behaviour, you are presented with Plack’s ‘Internal Server Error’ message instead of the data.
Why is this error happening?
Navigating to your plack error log (it should be in
/var/log/koha/<instance name>/plack-error.log, you may come across see the following entry:
Can't call method "authtypetext" on an undefined value at /usr/share/koha/opac/cgi-bin/opac/opac-authoritiesdetail.pl line 89.
This error indicates that each free-floating subdivision record imported into your authority file is not linked to a Koha authority type (topical term, chronological term, uniform title, etc.). Koha does not ship with an authority type for free-floating subdivisions; however, I discovered that the default value located in the the 942 tag within each free-floating subdivision record can be used to create a Koha authority type.
The key to correcting this error is to create a new authority type using the extant value in your authority records’ 942 field.
Correcting the Error
First, make sure that field 942 is visible in the Koha editor screen. You can do this by navigating to tag 942 within the authority type Default framework section of Koha –> Administration:
Second, you want to review the default value in tag 942 of a free-floating subdivision record and use it to create a new authority type. Open a free-floating subdivision record in the staff client as if you were going to edit it and click on the ‘9’ tab. You will see the following:
GEN_SUBDIV will be your new authority type code.
Third, create a new authority type:
The end result should look something like this:
For the ‘Authority field to copy’ field, I used MARC21 authority field 180.
Depending on your set-up, Koha should now have relinked all of your free-floating subdivisions automatically with this newly created authority type. The latter will also now show up as a search option in the OPAC Authority Browser. Here’s an example:
When a user clicks on the ‘Details’ button, the expected behaviour is seen and they are taken to the relevant MARC data page.