[Bug 23230] New: Make Koha::Plugins::Base::_version_compare OO
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Bug ID: 23230 Summary: Make Koha::Plugins::Base::_version_compare OO 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 This method is to be run inside plugin objects that inherit from Koha::Plugins::Base, but calling $self->_version_compare(); won't work because the method doesn't expect $self to be passed. -- 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=23230 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20669 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20669 [Bug 20669] Add upgrade method to plugins -- 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=23230 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Tomás Cohen Arazi from comment #0)
This method is to be run inside plugin objects that inherit from Koha::Plugins::Base, but calling
$self->_version_compare();
won't work because the method doesn't expect $self to be passed.
We should make it work either way since historically it has been non-OO and there are some plugins that may be using it in a non-OO way. I think ti should be easy to check the first parameter to know if it is being called as an object method or not! -- 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=23230 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 91152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91152&action=edit Bug 23230: Unit tests -- 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=23230 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 91153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91153&action=edit Bug 23230: Make _version_compare OO context aware On using _version_compare in plugins development, it would be nice if it was able to be called as an object method. This way we don't need to fully qualify it like this: Koha::Plugins::Base::_version_compare and we can do $self->_version_compare instead. This patch implements this behavior change. It is backwards compatible so plugins using the 'old way' don't break. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: Tests fail - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D -- 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=23230 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |Needs Signoff -- 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=23230 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=23230 --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 91201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91201&action=edit Bug 23230: (follow-up) Fix broken tests Before patch, the new tests don't run. After patch, they do. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 M. Tompsett <mtompset@hotmail.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=23230 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #91152|0 |1 is obsolete| | Attachment #91153|0 |1 is obsolete| | Attachment #91201|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 91202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91202&action=edit Bug 23230: Unit tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 91203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91203&action=edit Bug 23230: Make _version_compare OO context aware On using _version_compare in plugins development, it would be nice if it was able to be called as an object method. This way we don't need to fully qualify it like this: Koha::Plugins::Base::_version_compare and we can do $self->_version_compare instead. This patch implements this behavior change. It is backwards compatible so plugins using the 'old way' don't break. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: Tests fail - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 91204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91204&action=edit Bug 23230: (follow-up) Fix broken tests Before patch, the new tests don't run. After patch, they do. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to M. Tompsett from comment #4)
Created attachment 91201 [details] [review] Bug 23230: (follow-up) Fix broken tests
Before patch, the new tests don't run. After patch, they do.
I wonder what bug I attached my version of this patch he he -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Kyle M Hall <kyle@bywatersolutions.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=23230 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #91202|0 |1 is obsolete| | Attachment #91203|0 |1 is obsolete| | Attachment #91204|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 91220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91220&action=edit Bug 23230: Unit tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 91221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91221&action=edit Bug 23230: Make _version_compare OO context aware On using _version_compare in plugins development, it would be nice if it was able to be called as an object method. This way we don't need to fully qualify it like this: Koha::Plugins::Base::_version_compare and we can do $self->_version_compare instead. This patch implements this behavior change. It is backwards compatible so plugins using the 'old way' don't break. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: Tests fail - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 91222 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91222&action=edit Bug 23230: (follow-up) Fix broken tests Before patch, the new tests don't run. After patch, they do. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |19.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|19.11.00 |19.11.00,19.05.03 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #14 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- This is very useful for plugins so I choose to backport to stable. Pushed to 19.05.x for 19.05.03 Note this commit in master is not needed for 19.05.x : Bug 23230: (RM follow-up) Add rollback to plugin test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #15 from Lucas Gass <lucas@bywatersolutions.com> --- everything applied cleanly and passed test so i am backporting this enchancment backported to 18.11.x for 18.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23230 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |Plugin architecture |and plumbing | CC| |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=23230 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Plugin architecture |Architecture, internals, | |and plumbing -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org