Bug 13635 - $record->title is called even if marc flavour is UNIMARC
Summary: $record->title is called even if marc flavour is UNIMARC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 10975 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-28 12:02 UTC by Jonathan Druart
Modified: 2015-12-03 22:03 UTC (History)
8 users (show)

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


Attachments
Bug 13635: Unimarc - On editing a notice, the title should be displayed (1.77 KB, patch)
2015-01-28 12:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13635: Remove another useless call (1.01 KB, patch)
2015-01-28 12:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13635: Unimarc - On editing a notice, the title should be displayed (3.16 KB, patch)
2015-03-04 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 13635: Unimarc - On editing a notice, the title should be displayed (3.40 KB, patch)
2015-03-04 17:33 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 13635: Unimarc - On editing a notice, the title should be displayed (3.43 KB, patch)
2015-03-05 12:42 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
[PASSED QA] Bug 13635: Unimarc - On editing a notice, the title should be displayed (3.49 KB, patch)
2015-03-05 14:29 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2015-01-28 12:02:56 UTC
The title method of MARC::Record does not deal with UNIMARC, it should not be called if the marc flavour is UNIMARC.
Comment 1 Jonathan Druart 2015-01-28 12:05:56 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-01-28 12:10:26 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2015-03-04 13:16:38 UTC
Hi Jonathan,
Seems that 'usmarc' is not a valid value for 'marcflavour' syspref,
only MARC21, UNIMARC and NORMARC

And the same error is on line 916 of addbiblio.pl

Perhaps is better to write the code as:

if ( $record ne "-1" ) {
    if ( C4::Context->preference('marcflavour') =~/unimarc/i ) {
        $template->param( title => $record->subfield('200',"a") );
    } else {
        $template->param( title => $record->title() );
    }
}

... unless I'm mistaken.
Comment 4 Jonathan Druart 2015-03-04 16:15:48 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-03-04 16:16:30 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #3)
> Hi Jonathan,
> Seems that 'usmarc' is not a valid value for 'marcflavour' syspref,
> only MARC21, UNIMARC and NORMARC
> 
> And the same error is on line 916 of addbiblio.pl
> 
> Perhaps is better to write the code as:
> 
> if ( $record ne "-1" ) {
>     if ( C4::Context->preference('marcflavour') =~/unimarc/i ) {
>         $template->param( title => $record->subfield('200',"a") );
>     } else {
>         $template->param( title => $record->title() );
>     }
> }
> 
> ... unless I'm mistaken.

Yes of course, you are right!
Now patch attached.
Comment 6 Bernardo Gonzalez Kriegel 2015-03-04 17:33:48 UTC Comment hidden (obsolete)
Comment 7 aloij 2015-03-05 12:02:50 UTC
Tested on UNIMARC install
the title is displayed correctly in the instructions with this patch
signed-off
Comment 8 aloij 2015-03-05 12:39:55 UTC
(In reply to aloij from comment #7)
> Tested on UNIMARC install
> the title is displayed correctly in the "edit record" with this patch
> signed-off
Comment 9 Biblibre Sandboxes 2015-03-05 12:42:13 UTC
Patch tested with a sandbox, by joel aloi <aloi54@live.fr>
Comment 10 Biblibre Sandboxes 2015-03-05 12:42:33 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2015-03-05 14:29:39 UTC
Created attachment 36607 [details] [review]
[PASSED QA] Bug 13635: Unimarc - On editing a notice, the title should be displayed

The title method of MARC::Record does not deal with UNIMARC, it should
not be called if the marc flavour is UNIMARC.

Test plan:
On an unimarc installation, edit a notice, with this patch you should
see
 "Editing TITLE (Record number BIBLIONUMBER)"

Without, the title was not displayed.
Same in the breadcrumbs.

Bug 13635: Remove another useless call

There is another call to the title method in additem.pl without any
check on the marc flavour.
But here the title variable sent to the template is redefined 3 lines
later.
So it can be simply removed.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Tested on UNIMARC install, editing a 'record' (not notice) does not show
title on breadcrumbs, status bar or page title.
With patch it does!
No koha-qa errors.

Signed-off-by: joel aloi <aloi54@live.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 12 Tomás Cohen Arazi 2015-03-05 15:37:14 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 13 Chris Cormack 2015-03-12 07:21:14 UTC
Pushed to 3.18.x will be in 3.18.5
Comment 14 Mason James 2015-03-26 02:43:59 UTC
Pushed to 3.16.x, will be in 3.16.9
Comment 15 Jonathan Druart 2015-04-22 11:31:28 UTC
*** Bug 10975 has been marked as a duplicate of this bug. ***