Description
Jonathan Druart
2015-01-28 12:02:56 UTC
Created attachment 35575 [details] [review] 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. Created attachment 35576 [details] [review] 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. 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. Created attachment 36502 [details] [review] 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. (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. Created attachment 36507 [details] [review] [SIGNED-OFF] 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. Tested on UNIMARC install the title is displayed correctly in the instructions with this patch signed-off (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 Patch tested with a sandbox, by joel aloi <aloi54@live.fr> Created attachment 36575 [details] [review] 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> 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> Patch pushed to master. Thanks Jonathan! Pushed to 3.18.x will be in 3.18.5 Pushed to 3.16.x, will be in 3.16.9 *** Bug 10975 has been marked as a duplicate of this bug. *** |