[Bug 21909] New: Koha::Account::outstanding_* methods should preserve call context
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Bug ID: 21909 Summary: Koha::Account::outstanding_* methods should preserve call context Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org They should return lists in list context, and the iterator in scalar, as other methods like '->lines'. -- 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=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20946, 20990 Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20946 [Bug 20946] Cannot pay fines for patrons with credits https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 [Bug 20990] Add Koha::Account::outstanding_credits -- 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=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82746 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82746&action=edit Bug 21909: Unit tests This patch introduces regression tests for the behaviour to be introduced. Both outstanding_credits and outstanding_debits methods should return a Koha::Account::Lines object in scalar context, and a list of Koha::Account::Line objects in list context. To test: - Apply this patch - Run $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: The current behaviour doesn't match the described -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82747 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82747&action=edit Bug 21909: Make Koha::Account::outstanding_* preserve context This patch modifies the methods so they preserve the caller's context (list and scalar). To test: - Apply the first patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: outstanding_credits and outstanding_debits tests fail - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t => SUCCESS: We are so happy now :-D - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82748 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82748&action=edit Bug 21909: Add return type explanation to POD -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82746|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 82751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82751&action=edit Bug 21909: Unit tests This patch introduces regression tests for the behaviour to be introduced. Both outstanding_credits and outstanding_debits methods should return a Koha::Account::Lines object in scalar context, and a list of Koha::Account::Line objects in list context. To test: - Apply this patch - Run $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: The current behaviour doesn't match the described Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82747|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 82752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82752&action=edit Bug 21909: Make Koha::Account::outstanding_* preserve context This patch modifies the methods so they preserve the caller's context (list and scalar). To test: - Apply the first patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: outstanding_credits and outstanding_debits tests fail - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t => SUCCESS: We are so happy now :-D - Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82748|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 82753 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82753&action=edit Bug 21909: Add return type explanation to POD Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice catch, works as expected.. Signing Off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.com |y.org | CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82751|0 |1 is obsolete| | Attachment #82752|0 |1 is obsolete| | Attachment #82753|0 |1 is obsolete| | --- Comment #8 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 82799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82799&action=edit Bug 21909: Unit tests This patch introduces regression tests for the behaviour to be introduced. Both outstanding_credits and outstanding_debits methods should return a Koha::Account::Lines object in scalar context, and a list of Koha::Account::Line objects in list context. To test: - Apply this patch - Run $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: The current behaviour doesn't match the described Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #9 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 82800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82800&action=edit Bug 21909: Make Koha::Account::outstanding_* preserve context This patch modifies the methods so they preserve the caller's context (list and scalar). To test: - Apply the first patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: outstanding_credits and outstanding_debits tests fail - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t => SUCCESS: We are so happy now :-D - Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #10 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 82801 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82801&action=edit Bug 21909: Add return type explanation to POD Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply CC| |nick@bywatersolutions.com --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Simple rebase needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82800|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82801|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82799|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 83511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83511&action=edit Bug 21909: Unit tests This patch introduces regression tests for the behaviour to be introduced. Both outstanding_credits and outstanding_debits methods should return a Koha::Account::Lines object in scalar context, and a list of Koha::Account::Line objects in list context. To test: - Apply this patch - Run $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: The current behaviour doesn't match the described Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 83512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83512&action=edit Bug 21909: Make Koha::Account::outstanding_* preserve context This patch modifies the methods so they preserve the caller's context (list and scalar). To test: - Apply the first patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: outstanding_credits and outstanding_debits tests fail - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t => SUCCESS: We are so happy now :-D - Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 83513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83513&action=edit Bug 21909: Add return type explanation to POD Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Nick Clemens from comment #11)
Simple rebase needed
Tests count mismatch, done! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable Severity|enhancement |minor --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm changing this from 'enhancement' to 'minor' as I believe it was a mistake and thus a bug in the first place for the caller context to be lost.. as such: Pushed to 18.11.x for 18.11.02. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> --- cannot cleanly apply this for 18.05. if this is needed in 18.05 can we please rebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Lucas Gass from comment #18)
cannot cleanly apply this for 18.05. if this is needed in 18.05 can we please rebase.
You can skip it, Lucas. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org