Bug 9282 - authorities auto-completion in mainmainentry
Summary: authorities auto-completion in mainmainentry
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 13:35 UTC by Fridolin Somers
Modified: 2014-12-07 20:02 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (8.03 KB, patch)
2012-12-13 13:56 UTC, Fridolin Somers
Details | Diff | Splinter Review
Proposed patch (follow-up 1) (1.67 KB, patch)
2012-12-13 13:58 UTC, Fridolin Somers
Details | Diff | Splinter Review
[PATCH] [SIGNED OFF] Bug 9282: authorities auto-completion in mainmainentry (8.10 KB, patch)
2013-01-22 09:09 UTC, mathieu saby
Details | Diff | Splinter Review
[PATCH 2/2] [SIGNED OFF] Bug 9282: Followup : authtypecode missing in auto-completion (1.74 KB, patch)
2013-01-22 09:11 UTC, mathieu saby
Details | Diff | Splinter Review
Bug 9282: authorities auto-completion in mainmainentry (8.31 KB, patch)
2013-07-11 09:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 9282: Followup : authtypecode missing in auto-completion (1.83 KB, patch)
2013-07-11 09:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2012-12-13 13:35:43 UTC
In authorities popup search (auth_finder.pl), some search inputs have auto-completion : 
- Anywhere
- Main entry
- Main entry ($a only), alias mainmainentry

For anywhere and main entry, auto-completion works well : select a term and launch search, you will find authorities.
For mainmainentry, select a term and launch search, you will sometimes not find authorities.
It is because auto-compete returns authorities headings, composed of $a and other subfields of heading field whereas search on mainmainentry will only look in $a.

I propose that auto-completion of mainmainentry field return a list of the mainmainentry of found authorities.
Comment 1 Fridolin Somers 2012-12-13 13:56:22 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2012-12-13 13:58:22 UTC Comment hidden (obsolete)
Comment 3 mathieu saby 2013-01-22 09:05:51 UTC
I tested on my VM :
I created 2 authorities author :
- Melot, Michel (professeur, 1956-....)
- Melot, Pierre

Without the patch :
1. I enter "Mel" in "Main entry ($a only)" field
2. The autocompletion gives me the 2 complete names : "Melot, Michel (professeur, 1956-....)" and "Melot, Pierre". 
3. I click on one of the 2 names
4. The field filled in with the complete name (ex :"Melot Pierre").
5. I click on "Start Search"
6. "No result found"

With the patch :
1. I enter "Mel" in "Main entry ($a only)" field
2. The autocompletion gives me just 1 lastname "Melot"
3. I click on "Melot"
4. The field filled in with the lastname
5. I click on "Start Search"
6. 2 results : "Melot, Michel (professeur, 1956-....)" and "Melot, Pierre". 

I sign off
M. Saby
Rennes 2 university
Comment 4 mathieu saby 2013-01-22 09:09:52 UTC Comment hidden (obsolete)
Comment 5 mathieu saby 2013-01-22 09:11:41 UTC Comment hidden (obsolete)
Comment 6 Paul Poulain 2013-03-21 09:02:58 UTC
Katrin, Jonathan or I should not QA this one, because it's worth having a MARC21 point of view (event if I don't really fear something wrong)
So, giving you this one.
Comment 7 Fridolin Somers 2013-06-17 11:43:35 UTC
Someone to QA ?
Comment 8 Marcel de Rooy 2013-06-17 11:48:57 UTC
(In reply to comment #7)
> Someone to QA ?

I will if someone does not beat me to it.
Note that adding a comment drops you from top of the list to the very end (when sorting by Change date).
Will try to remember.
Comment 9 Marcel de Rooy 2013-06-20 06:59:05 UTC
QA: Looking now..
Comment 10 Marcel de Rooy 2013-06-20 07:26:18 UTC
Looks quite good to me, but I am wondering about this now:

            } elsif ($tag eq '180') {
                $subfields_to_report = 'vxyz';
[etc. etc. etc.]
            if ($subfields_to_report) {
                push @authorized, {
                    heading => $field->as_string($subfields_to_report),
                    hemain  => $field->subfield( substr($subfields_to_report, 0, 1) ),

If you use the first char here, you will take $v into hemain. But I think that you should take $x for the 18X fields.
I would like to see a response from Jared here, as I assume that he was responsible for quite some changes in this module. Could you please attract his attention? Thanks.

Changing status to reflect need for clarification.
Comment 11 Jared Camins-Esakov 2013-07-07 12:04:49 UTC
(In reply to M. de Rooy from comment #10)
> Looks quite good to me, but I am wondering about this now:
> 
>             } elsif ($tag eq '180') {
>                 $subfields_to_report = 'vxyz';
> [etc. etc. etc.]
>             if ($subfields_to_report) {
>                 push @authorized, {
>                     heading => $field->as_string($subfields_to_report),
>                     hemain  => $field->subfield(
> substr($subfields_to_report, 0, 1) ),
> 
> If you use the first char here, you will take $v into hemain. But I think
> that you should take $x for the 18X fields.
> I would like to see a response from Jared here, as I assume that he was
> responsible for quite some changes in this module. Could you please attract
> his attention? Thanks.

As hemain is used for mainmainentry, the search does not make sense for 18x authorities anyway, as there is no Main Entry for 18x authorities. However, since 18x authorities are not supported in any useful way by Koha, and probably never will be, I see no problem with pushing the code as-is.
Comment 12 Marcel de Rooy 2013-07-11 09:36:23 UTC
Created attachment 19551 [details] [review]
Bug 9282: authorities auto-completion in mainmainentry

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised.
Tested with an authority where I added my search term in $b.
The modified authority came up in main entry, not in mainmainentry.
That was the desired result.
Comment 13 Marcel de Rooy 2013-07-11 09:36:29 UTC
Created attachment 19552 [details] [review]
Bug 9282: Followup : authtypecode missing in auto-completion

Signed-off by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Marcel de Rooy 2013-07-11 09:41:10 UTC
QA Comment:
See also former comment and response from Jared.
Further looks good to me.
Note that hemain is not the most attractive/descriptive variable name, but it works :)

Passed QA
Comment 15 Galen Charlton 2013-10-10 22:50:40 UTC
Pushed to master.  Thanks, Fridolyn!