Bug 22969 - fix biblionumber on 001 in UNIMARC XSLT
Summary: fix biblionumber on 001 in UNIMARC XSLT
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-23 05:54 UTC by Fridolin SOMERS
Modified: 2019-05-27 12:14 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22969: fix biblionumber on 001 in UNIMARC XSLT (3.89 KB, patch)
2019-05-23 05:57 UTC, Fridolin SOMERS
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2019-05-23 05:54:41 UTC
In UNIMARC default configuration the 001 is linked to biblio.biblionumber.
In some XSLT files, 090$a is used.
This is by default biblioitems.biblionumber so it usually works but it may not be the same and var biblionumber is used to create hyperlinks to record detail page.
Comment 1 Fridolin SOMERS 2019-05-23 05:57:34 UTC
Created attachment 89994 [details] [review]
Bug 22969: fix biblionumber on 001 in UNIMARC XSLT

In UNIMARC default configuration the 001 is linked to biblio.biblionumber.
In some XSLT files, 090$a is used.
This is by default biblioitems.biblionumber so it usually works but it may not be the same and var biblionumber is used to create hyperlinks to record detail page.

Test plan :
1) Use UNIMARC database
2) Set default in all XSLT system preferences
3) At OPAC, perform a search and click on a result
4) Check displayed page shows the correct biblio record
5) Same at intranet
Comment 2 Andreas Roussos 2019-05-23 17:08:37 UTC
Hi Fridolin,

(In reply to Fridolin SOMERS from comment #0)
> In UNIMARC default configuration the 001 is linked to biblio.biblionumber.
> In some XSLT files, 090$a is used.
> This is by default biblioitems.biblionumber so it usually works but it may
> not be the same and var biblionumber is used to create hyperlinks to record
> detail page.
I think 090$a is linked to biblioitems.biblioitemnumber in UNIMARC default
configuration for English (see lines 75-76 of installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql).

While trying to sign off your patch I realised that in my test UNIMARC DB
with just four records the values for biblionumber and biblioitemnumber
are the same in the SQL tables that I checked:

MariaDB [koha_test]> SELECT biblionumber FROM biblio ;
+--------------+
| biblionumber |
+--------------+
|            1 |
|            3 |
|            4 |
|            5 |
+--------------+

MariaDB [koha_test]> SELECT biblionumber, biblioitemnumber FROM biblioitems ;
+--------------+------------------+
| biblionumber | biblioitemnumber |
+--------------+------------------+
|            1 |                1 |
|            3 |                3 |
|            4 |                4 |
|            5 |                5 |
+--------------+------------------+

MariaDB [koha_test]> SELECT biblionumber, biblioitemnumber FROM items ;
+--------------+------------------+
| biblionumber | biblioitemnumber |
+--------------+------------------+
|            1 |                1 |
|            3 |                3 |
|            3 |                3 |
|            4 |                4 |
|            4 |                4 |
|            5 |                5 |
+--------------+------------------+

When I set all XSLT system preferences to 'default', the hyperlinks in
the search results work OK (without the patch applied).

So, under what circumstances does this problem occur?
How can I create a record that has biblionumber != biblioitemnumber?
Comment 3 Fridolin SOMERS 2019-05-27 12:14:07 UTC
(In reply to Andreas Roussos from comment #2)
> 
> So, under what circumstances does this problem occur?
> How can I create a record that has biblionumber != biblioitemnumber?

Hi, indeed it should usually not occur.
I think it sometimes appears when some insert in catalog fail to insert in biblio but create a row in biblioitems. In this case autoincrement of biblioitems.biblioitemnumber is higher than biblio.biblionumber.

You may try a modification in direct SQL :
UPDATE biblioitems SET biblioitemnumber = 6 WHERE biblioitemnumber=5;

Only for a test database !