[Koha-bugs] [Bug 26480] With UseControlNumber on, "Show analytics" link doesn't show on parent record

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 12 19:17:40 CET 2020


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

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #10 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
I've managed to reproduce this issue, but it took me a while to figure.

As a start, I have to say that bug 15851 only highlighted another issue. That
bug introduced a search to be done before rendering the detail page:

'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)'

This search is the exact same search already existed on the always-diplayed
link. In other words, if the link is not showing, it is because there are no
results. And this means if we showed the link, it wouldn't produce results
either.

I managed to reproduce it simply by picking a record from the sample data, that
contains a 001 field, and using the 'New child record'. Add a title, fix the
missing fields and save.

The host record didn't show the analytics link.

But also Zebra didn't return any results:

root at kohadevbox:koha(bug_26480)$ yaz-client
unix://var/run/koha/kohadev/bibliosocket
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID     : 81
Name   : Zebra Information Server/GFS/YAZ
Version: 4.2.30 98864b44c654645bc16b2c54f822dc2e45a93031
Options: search present delSet triggerResourceCtrl scan sort extendedServices
namedResultSets
Elapsed: 0.006809
Z> base biblios
Z> f @and @attr 1=1045 14207979 @or @attr 1=1021 a @attr 1=1021 b
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 0, setno 1
SearchResult-1: term=14207979 cnt=1, term=a cnt=2, term=b cnt=1
records returned: 0
Elapsed: 0.006004
Z>

The CCL version (more readable, similar to the code) gives the same results:

Z> querytype ccl2rpn
Z> set_cclfile /etc/koha/zebradb/ccl.properties
Z> f rcn=14207979 AND (bib-level=a OR bib-level=b)
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 0, setno 2
SearchResult-1: term=14207979 cnt=1, term=a cnt=2, term=b cnt=1
records returned: 0
Elapsed: 0.008100
Z>

So the next step was to look for what is our pipeline sending Zebra for
indexing:

root at kohadevbox:koha(bug_26480)$ xsltproc
/etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl <(sudo
koha-mysql kohadev <<< \
"select  metadata from biblio_metadata where biblionumber=443 limit 1\\G" | \
sed -n 's/metadata: //;2,$p' )
<?xml version="1.0" encoding="UTF-8"?>
<z:record xmlns:z="http://indexdata.com/zebra-2.0"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" type="update"
z:id="443">
  <z:index name="llength:w">00337</z:index>
  <z:index name="rtype:w"> </z:index>
  <z:index name="Bib-level:w"> </z:index>
  <z:index name="Date/time-last-modified:w">20201112180000.0</z:index>
  <z:index name="date-entered-on-file:n">20111</z:index>
  <z:index name="date-entered-on-file:s">20111</z:index>
  <z:index name="pubdate:w">    </z:index>
  <z:index name="pubdate:n">    </z:index>
  <z:index name="pubdate:y">    </z:index>
  <z:index name="pubdate:s">    </z:index>
  <z:index name="pl:w">   </z:index>
  <z:index name="ta:w">|</z:index>
  <z:index name="ff8-23:w"> </z:index>
  <z:index name="ff8-29:w">0</z:index>
  <z:index name="lf:w">0</z:index>
  <z:index name="bio:w"> </z:index>
  <z:index name="ln:w">eng</z:index>
  <z:index name="ctype:w">||||</z:index>
  <z:index name="Record-source:w"/>
  <z:index name="Title-cover:w Title-cover:p Title-cover:s Title:w
Title:p">Algo algo</z:index>
  <z:index name="Host-item:w">Conway, Damian</z:index>
  <z:index name="Host-item:w">Perl best practices /</z:index>
  <z:index name="Record-control-number:w">14207979</z:index>
  <z:index name="cn-bib-source:w">ddc</z:index>
  <z:index name="itemtype:w itemtype:p itype:w itype:p">CF</z:index>
  <z:index name="Local-Number:n Local-Number:w Local-Number:s">443</z:index>
  <z:index name="biblioitemnumber:n biblioitemnumber:w
biblioitemnumber:s">443</z:index>
  <z:index name="Code-institution:w Record-source:w">Ost</z:index>
  <z:index name="Title:w Title:p">Algo algo</z:index>
  <z:index name="itype:0">CF</z:index>
  <z:index name="Any:w Any:p">
...<output truncated, it is just Any indexes>

You can see there is Record-control-number, with the right value on it. But if
you look closer, you will notice the Bib-level index is empty.

So that's it. I opened the record for editing, opened the LEADER builder,
everything looks correct. Close it. And now the LEADER has more data on it. And
on saving the searches in Zebra work, and the link is displayed as expected.

In my opinion, this might be a bug. On how the default leader value it built,
specifically on child records. Because when it is opened for creation, you see
the 'a' or 'b' value, but the rest of the leader is empty and saving it
produces a wrong behaviour.

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


More information about the Koha-bugs mailing list