Koha-clms/authorities
Fridolyn SOMERS cc6fcc1c27 Bug 7442: fix crash when selecting an authority with 200$x or 200$y (UNIMARC)
From a biblio record, if one wants to add a 600$a information, a pop-up
appears.  On this new window, on search terms typed and validated, a table
result is displayed, with a column "Get It!" allowing the selection of an
authority.  From here, different cases:

1) If we have a simple authority with 200$a and 200$b subfields, a link
   "choose" is displayed, working correctly.

2) If the authority has different occurences of 200$a/200$b, numeric links (1 2
   and so on) are displayed, one for each occurence.  In the example of my
   screenshot, the line with a "Paul, Korky -- Pauline, Korkette" summary
   possesses two links : "1" will add "Paul, Korky" whereas "2" will add
   "Pauline, Korkette" (couldn't come up with a better name ;)).

3) If the authority has 200$x or 200$y subfields defined, several links are
   also created, when it should not be the case.  In our example, "Niclausse,
   Paul -- Expositions" will create a link "1" for "Niclausse, Paul" and a link
   "2" for "Expositions".  Clicking on the 2nd link leads to the following
   error: Software error: Can't call method "subfields" on an undefined value
   at
   /home/asaurat/workspace/versions/community/authorities/blinddetail-biblio-search.pl
   line 86.  Only the cases 1 and 2 should be handled. The creation of links
   for subfields like 200$x or 200$y should be removed.

This problem is caused by the use of " -- " has separator of authorities with
several headings, but also in some heading between main part and subdivisions.
This patch corrects this by using an array in authorities summary so that
presentation is computed in template. I've choosen to use the pipe separator
between authorities with several headings. This may be changed to be
configurable.

Test plan :

- Edit an authority type summary : for example subject (heading on 250) :
  summary "[250a][ -- 250x]"
- Create an authority A1 with one heading and a subdivision : for example a
  subject : 250$a "History" 250$x "20th century"
- Create an authority A2 with several headings. for example a subject : 250$a
  "History" 250$a "Legends"
- Rebuild Zebra queue
- Go to OPAC and click on "Authority search" and search on "History"
  => You will find A1 and A2 :
    History -- 20th century
    History | Legends
- Go to intranet autorities search and search on "History"
  => You will find A1 and A2 :
    History -- 20th century
    History | Legends
- Edit a record using this autorities type as thesaurus : for example on 606$a
- Click on thesaurus link and search on "History"
  => You will find A1 and A2 :
    History -- 20th century ; 0 times ; choose ; Edit authority
    History | Legends       ; 0 times ; 1 2    ; Edit authority
- Click on link "2" to chosse "Legends"
  => You get "Legends" in heading field : for example 606$a

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

I can confirm the problem and the solution. I have tested the patch on a large
DB with authorities having multiples headings. There is no regression on bug
4838.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Without the patch I couldn't choose between multiple headings
in the authority plugin, but with the patch it works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 99dbc5cdf7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2014-10-16 12:31:53 +02:00
..
auth_finder.pl Bug 7442: fix crash when selecting an authority with 200$x or 200$y (UNIMARC) 2014-10-16 12:31:53 +02:00
authorities-home.pl Revert "Bug 6554 - make Koha internally utf-8 clean" 2013-04-29 15:12:32 -07:00
authorities-list.pl Bug 6752: Be stricter with utf-8 encoding of output 2012-01-27 12:11:06 +01:00
authorities.pl Bug 11313: supply empty value in mandatory comboboxs in MARC record editors 2014-04-23 19:06:40 +02:00
blinddetail-biblio-search.pl Bug 11955: Remove spaces in empty indicators when linking an authority to a biblio record. 2014-08-06 11:59:21 +02:00
detail-biblio-search.pl Bug 8709: Subfield 0 does not show in MARC detail in intranet 2012-09-18 11:36:07 +02:00
detail.pl Bug 8523: Display auth hierarchies w/all marcflavours 2012-09-21 14:52:08 +02:00
export.pl Bug 10888: Don't hide authorities module from users who lack permission to edit authorities 2013-09-21 17:59:05 +00:00
merge.pl Bug 11652: ensure that merging authority records corrects biblios 2014-05-19 15:55:27 +02:00
merge_ajax.pl Bug 5202: merge authorities from the authority file and reservoir 2013-10-10 21:32:27 +00:00
ysearch.pl Bug 9282: (follow-up) remove log noise caused by authorities/ysearch.pl 2013-10-10 22:46:18 +00:00