Summary: | Missing subroutine in overdue_notices.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Command-line Utilities | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | blocker | ||
Priority: | P5 - low | CC: | jonathan.druart, martin.renvoize, robin, tomascohen, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 12933 | ||
Bug Blocks: | |||
Attachments: |
Bug 15242 - Missing subroutine in overdue_notices.pl
Bug 15242 - Missing subroutine in overdue_notices.pl Bug 15242 - Missing subroutine in overdue_notices.pl [SIGNED OFF] Bug 15242 - Missing subroutine in overdue_notices.pl Bug 15242 - Missing subroutine in overdue_notices.pl |
Description
Nick Clemens (kidclamp)
2015-11-23 15:41:24 UTC
Created attachment 45105 [details] [review] Bug 15242 - Missing subroutine in overdue_notices.pl This patch changes the call to parse_overdues_letter to use the full namespace to ensure the subroutine can be found. Created attachment 45115 [details] [review] Bug 15242 - Missing subroutine in overdue_notices.pl This patch changes the call to parse_overdues_letter to use the full namespace to ensure the subroutine can be found. Signed-off-by: Marc Véron <veron@veron.ch> QA Style note, we tend to import routines over adding full namespaces.. I'd prefer to stick to that standard unless you can come up with a good/valid reason against doing so? We have this line at the top of the script: 43 use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes); I think adding the new routine the same way would be more consistent. Can you please provide a new patch? (In reply to Martin Renvoize from comment #3) > QA Style note, we tend to import routines over adding full namespaces.. (...) There is one more full name space in line 323: my @overduebranches = C4::Overdues::GetBranchcodesWithOverdueRules(); I think this should be fixed as well to be consistent. Ah, is it necessary that the subs are exported in C4/Overdues.pm? Line 47 following: GetBranchcodesWithOverdueRules is not listed Oh man we're inconsistent in this script :(. Well spotted Marc, reading C4::Overdues I note it's using EXPORT instead of EXPORT_OK too :(. Personally, I believe if a routine is intended to be used in another module it should appears in the EXPORT_OK block not the EXPORT block, and that it should be explicitly imported into the using module with a use statement. So.. if I were being picky I'd say.. convert the EXPORT to EXPORT_OK (but this may break modules that expect to have access to the routines without explicitly importing them :( ), add the routine your found to the EXPORT_OK block also, and then clean up here to match. Perhaps split the work into two bugs.. one clean up and one just fixing the initial bug.. thoughts? s/this script/these scripts/ I think best to fix the one problem identified here ... and do general cleanup separately :) (In reply to Katrin Fischer from comment #8) > I think best to fix the one problem identified here ... and do general > cleanup separately :) +1 :-) Created attachment 45124 [details] [review] Bug 15242 - Missing subroutine in overdue_notices.pl This patch changes the call to parse_overdues_letter to use the full namespace to ensure the subroutine can be found. Created attachment 45137 [details] [review] [SIGNED OFF] Bug 15242 - Missing subroutine in overdue_notices.pl This patch changes the call to parse_overdues_letter to use the full namespace to ensure the subroutine can be found. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Created attachment 45144 [details] [review] Bug 15242 - Missing subroutine in overdue_notices.pl This patch changes the call to parse_overdues_letter to use the full namespace to ensure the subroutine can be found. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (In reply to Martin Renvoize from comment #3) > QA Style note, we tend to import routines over adding full namespaces.. > > I'd prefer to stick to that standard unless you can come up with a > good/valid reason against doing so? And I prefer the other way :) I personally think it adds readability and eases refactoring. Patch pushed to master. Thanks Nick! |