[Bug 27660] New: Should getletter not use the fallback to default ?
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Bug ID: 27660 Summary: Should getletter not use the fallback to default ? Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Looking at the code: sub getletter { my ( $module, $code, $branchcode, $message_transport_type, $lang) = @_; .. $lang = 'default' unless( $lang && C4::Context->preference('TranslateNotices') ); .. my $sth = $dbh->prepare(q{ SELECT * FROM letter WHERE module=? AND code=? AND (branchcode = ? OR branchcode = '') AND message_transport_type LIKE ? AND lang =? ORDER BY branchcode DESC LIMIT 1 }); $sth->execute( $module, $code, $branchcode, $message_transport_type, $lang ); my $line = $sth->fetchrow_hashref or return; .. I am just wondering if I miss something. If the language is passed (which is often just a $patron->lang or so), then we are fetching with that language! If that notice has not been translated yet, we will not fallback to en ?! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We should not fall back to en, but to whatever is the "Default" tab in that installation. I thought that was the case tbh :( -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #1)
We should not fall back to en, but to whatever is the "Default" tab in that installation. I thought that was the case tbh :(
Well look at the code carefully. It depends on a few conditions: 1) Do you use TranslateNotices pref 2) Did the patron fill in the language for notices? If you do and patron lang is e.g. 'en' but there is no notice for en, there is no fallback in the above. As long as most people not have filled the language, it does not hurt too much.. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- So I think you are right, but it should fallback to default :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- It's handled in GetPreparredLetter 638 $letter = getletter( $module, $letter_code, $branchcode, $mtt, $lang ); 639 640 unless ( $letter ) { 641 $letter = getletter( $module, $letter_code, $branchcode, $mtt, 'default' ) 642 or warn( "No $module $letter_code letter transported by " . $mtt ), 643 return; 644 } -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #4)
It's handled in GetPreparredLetter
638 $letter = getletter( $module, $letter_code, $branchcode, $mtt, $lang ); 639 640 unless ( $letter ) { 641 $letter = getletter( $module, $letter_code, $branchcode, $mtt, 'default' ) 642 or warn( "No $module $letter_code letter transported by " . $mtt ), 643 return; 644 }
Ah. Thats good. Didnt test it on master ;) Thx. Will have to check if there are other callers to getletter that dont do the same thing? And if this change in GetPreparedLetter came together in older versions.. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- getletter is the "raw" subroutine to get what you asked in parameter (for tools/letter.pl) It's correctly handled in GetPreparedLetter since the beginning, see commit c49bdc3a8d8e5a9389a27a8dca90544ff5c42f95 Bug 17762: Add the lang parameter to C4::Letters::getletter -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Looks like those occurrences need to be double-checked: members/printfeercpt.pl:my $letter = C4::Letters::getletter( 'circulation', 'ACCOUNT_CREDIT', C4::Context::mybranch, 'print', $patron->lang ); members/printinvoice.pl:my $letter = C4::Letters::getletter( 'circulation', 'ACCOUNT_DEBIT', C4::Context::mybranch, 'print', $patron->lang ); misc/cronjobs/overdue_notices.pl: my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode, undef, $patron->lang ); misc/cronjobs/overdue_notices.pl: my $letter_exists = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode, $effective_mtt, $patron->lang ) ? 1 : 0; pos/printreceipt.pl: C4::Letters::getletter( 'pos', 'RECEIPT', C4::Context::mybranch, 'print' ); -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26734 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I caught most of these occurrences in bug 26734.. looks like overdue slips need the same handling. It re-opens a question I raised in the roadmap sheet though: https://annuel.framapad.org/p/koha_21.05_roadmap Namely, "Should we converge back to /printslip.pl + circ/print-slip.tt or continue down the route of a controller + template for each slip type?" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Should getletter not use |Should getletter not use |the fallback to default ? |the fallback to default? Blocks| |28487 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28487 [Bug 28487] Overdue_notices does not fall back to default language -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |INVALID --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This is invalid, getletter should not have a fallback. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|28487 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28487 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28487 [Bug 28487] Overdue_notices does not fall back to default language -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** Bug 26787 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org