[Bug 15135] New: Remove Warning Subroutine HasOverdues redefined
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Bug ID: 15135 Summary: Remove Warning Subroutine HasOverdues redefined Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: veron@veron.ch QA Contact: testopia@bugs.koha-community.org In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To reproduce: - Go to Home > Patrons > Patron details for.... - Search for warning above in log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #1 from Marc Véron <veron@veron.ch> --- Created attachment 44466 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44466&action=edit Bug 15135: Remove Warning Subroutine HasOverdues redefined In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To test: - Go to Home > Patrons > Patron details for.... - Search for warning above in log - Apply patch - Verify that no more warnings appear - Verify that patron pages behave as before -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |veron@veron.ch Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44466|0 |1 is obsolete| | --- Comment #2 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44536 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44536&action=edit Bug 15135: Remove Warning Subroutine HasOverdues redefined In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To test: - Go to Home > Patrons > Patron details for.... - Search for warning above in log - Apply patch - Verify that no more warnings appear - Verify that patron pages behave as before Signed-off-by: Frederic Demians <f.demians@tamil.fr> Works as described -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12933 Status|Signed Off |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The plugin use a C4::Members subroutine, you should not remove this line. Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12933 [Bug 12933] Add ability to print overdue slip from staff intranet -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #4 from Marc Véron <veron@veron.ch> --- (In reply to Jonathan Druart from comment #3)
The plugin use a C4::Members subroutine, you should not remove this line.
Yes, you are right,there is a soubroutine called in line 57: return C4::Members::HasOverdues($borrowernumber); Because of the way it is called I supposed it is save to remove line 26: use C4::Members qw(HasOverdues); My mistake if that is wrong. What would be an alternative to get rid of the warning? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marc Véron from comment #4)
What would be an alternative to get rid of the warning?
Rename the subroutine or no warnings 'redefine'; But the no warnings is not a good solution. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 45172 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45172&action=edit Bug 15135 [QA Followup] - Switch from use to require -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Kyle, it's not a good idea to replace use with require, you are skipping the compilation pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|veron@veron.ch |gmcharlt@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #8 from Marc Véron <veron@veron.ch> --- Created attachment 46083 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46083&action=edit Bug 15135: Get rid of Warning 'Subroutine HasOverdues redefined' This patch renames the subroutine HasOverdues to WithOverdues in Koha/Template/Plugin/Borrowers.pm and in members-toolbar.inc (only place where it is used). To test: - First test without patch - Search for a patron with overdues (I used the 'Overdues' report on page Home > Cirulation - Display detail page, open drop down tool 'Print'. Verify that you have an item 'Print overdues' - Apply patch - Repeat steps above. Verify that the item 'Print overdues' still appears - Search for remaining occurences of HasOverdues in template files / template includes with git grep 'Patrons.HasOverdues'. There should not be any occurences. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45172|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44536|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #9 from Marc Véron <veron@veron.ch> --- New solution with renaming, see comment #5 and bug 12933 comment #67. Switching back to NSO -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46083|0 |1 is obsolete| | --- Comment #10 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 46166 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46166&action=edit Bug 15135: Get rid of Warning 'Subroutine HasOverdues redefined' This patch renames the subroutine HasOverdues to WithOverdues in Koha/Template/Plugin/Borrowers.pm and in members-toolbar.inc (only place where it is used). To test: - First test without patch - Search for a patron with overdues (I used the 'Overdues' report on page Home > Cirulation - Display detail page, open drop down tool 'Print'. Verify that you have an item 'Print overdues' - Apply patch - Repeat steps above. Verify that the item 'Print overdues' still appears - Search for remaining occurences of HasOverdues in template files / template includes with git grep 'Patrons.HasOverdues'. There should not be any occurences. Signed-off-by: Chris <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com Status|Signed Off |In Discussion --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Marc, The problem is that we have the same issue with IsDebarred. The current code tricks us using not exporting the IsDebarred method: use Koha::Borrower::Debarments qw(); Either we continue to trick: -use C4::Members qw(HasOverdues); +use C4::Members qw(); Or we fix both. But I am pretty sure that introducing another workaround is a good idea. I would like to get Martin and Kyle POV here. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #11) I should read before clicking the submit button...
The current code tricks us using not exporting the IsDebarred method:
s/using//
But I am pretty sure that introducing another workaround is a good idea.
is *not* a good idea -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #13 from Marc Véron <veron@veron.ch> --- Sorry, I have no other ideas. Maybe someone else finds a solution. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I agree adding another workaround is bad, doing it 'properly' is better. So, am I reading it right that basically we also need IsDebarred also renaming and then this patch could stand.. or have I misunderstood something? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #14)
I agree adding another workaround is bad, doing it 'properly' is better.
So, am I reading it right that basically we also need IsDebarred also renaming and then this patch could stand.. or have I misunderstood something?
No, you got it. Renaming them could work, but otoh it would make sense to keep the same name: the subroutines only call the corresponding subroutine/method. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- If I understood correctly, the problem is that we now have Borrowers::HasOverdues and Members::HasOverdues and similar for IsDebarred. Looking at the Borrowers plugin, not importing Overdues from Members there, resolves the warning for now and is consistent with the IsDebarred case. So I agree with Jonathan. Marc: Could you adjust your patch? Too bad btw that TT forces us to create a stub for each Koha routine we want to call in the templates. (Exception for OO modules as below)
From the TT docs: === If a regular Perl module supports an object-oriented interface and a new() constructor then it can be loaded and instantiated automatically like: [% USE file = IO.File('/tmp/mydata') %] ===
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #17 from Marc Véron <veron@veron.ch> --- (In reply to Marcel de Rooy from comment #16)
If I understood correctly, the problem is that we now have Borrowers::HasOverdues and Members::HasOverdues and similar for IsDebarred. Looking at the Borrowers plugin, not importing Overdues from Members there, resolves the warning for now and is consistent with the IsDebarred case. So I agree with Jonathan.
Marc: Could you adjust your patch?
Too bad btw that TT forces us to create a stub for each Koha routine we want to call in the templates. (Exception for OO modules as below)
From the TT docs: === If a regular Perl module supports an object-oriented interface and a new() constructor then it can be loaded and instantiated automatically like: [% USE file = IO.File('/tmp/mydata') %] ===
"...not importing Overdues from Members there..." Sorry, I lost track here (Ik ben the kluts kwijt). Wasn't that what I did in my very first patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marc Véron from comment #17)
(In reply to Marcel de Rooy from comment #16)
If I understood correctly, the problem is that we now have Borrowers::HasOverdues and Members::HasOverdues and similar for IsDebarred. Looking at the Borrowers plugin, not importing Overdues from Members there, resolves the warning for now and is consistent with the IsDebarred case. So I agree with Jonathan.
Marc: Could you adjust your patch?
Too bad btw that TT forces us to create a stub for each Koha routine we want to call in the templates. (Exception for OO modules as below)
From the TT docs: === If a regular Perl module supports an object-oriented interface and a new() constructor then it can be loaded and instantiated automatically like: [% USE file = IO.File('/tmp/mydata') %] ===
"...not importing Overdues from Members there..." Sorry, I lost track here (Ik ben the kluts kwijt). Wasn't that what I did in my very first patch?
No you removed the use completely there. You only should say: use Module qw(); In that case you do not import any routines in the current namespace. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #19 from Marc Véron <veron@veron.ch> --- Created attachment 46478 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46478&action=edit Bug 15135: Remove Warning Subroutine HasOverdues redefined In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To test: - Go to Home > Patrons > Patron details for.... - Search for warning above in log - Apply patch - Verify that no more warnings appear - Verify that patron pages behave as before (Solution as of comment #18) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46166|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 --- Comment #20 from Marc Véron <veron@veron.ch> --- Not quit sure, should that go back to "Needs Signoff"? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marc Véron from comment #20)
Not quit sure, should that go back to "Needs Signoff"?
I will add a signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46478|0 |1 is obsolete| | --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 46479 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46479&action=edit Bug 15135: Remove Warning Subroutine HasOverdues redefined In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To test: - Go to Home > Patrons > Patron details for.... - Search for warning above in log - Apply patch - Verify that no more warnings appear - Verify that patron pages behave as before (Solution as of comment #18) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Verified that warning disappears with this patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |veron@veron.ch Depends on|12933 | QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |Passed QA --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This patch now received enough attention to pass QA. Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12933 [Bug 12933] Add ability to print overdue slip from staff intranet -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15135 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46479|0 |1 is obsolete| | --- Comment #24 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 46481 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46481&action=edit Bug 15135: Remove Warning Subroutine HasOverdues redefined In staff client, while displying patron related pages (e.g. moremember.pl) you get a warning like: moremember.pl: Subroutine HasOverdues redefined at /usr/share/kohaclone/Koha/Template/Plugin/Borrowers.pm line 52. This occurs with all pages that have [% USE Borrowers %] in their templates (directly or via members-toolbar.inc) To test: - Go to Home > Patrons > Patron details for.... - Search for warning above in log - Apply patch - Verify that no more warnings appear - Verify that patron pages behave as before (Solution as of comment #18) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Verified that warning disappears with this patch. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org