[Bug 35133] New: Dynamical accessors
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Bug ID: 35133 Summary: Dynamical accessors 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: glasklas@gmail.com QA Contact: testopia@bugs.koha-community.org -- 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=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Dynamical accessors |Accessors defined in | |AUTOLOAD does not work if | |called with SUPER -- 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=35133 --- Comment #1 from David Gustafsson <glasklas@gmail.com> --- If overriding a accessor method in a child class of Koha::Object, and calling parent by invoking $self->SUPER->accessor_name, $AUTOLOAD in the AUTOLOAD method of KOHA::Object will be assigned the value Koha::ChildClass::SUPER::accessor_name instead of Koha::ChildClass::accessor_name. The next time $self->SUPER->accessor_name is called it will not be picked up, and AUTOLOAD will run again with a SubroutineKoha::ChildClass::SUPER::accessor_name redefined" warning, so obviously definition of lazy accessors does not work for those cases. I tried digging around to see if there is some way of defining autoloaded accessors that handles this case, but unfortunately did not find any relevant information on this. The only, probably safe, workaround is to not insert an entry into the dispatch table when $AUTOLOAD contains '::SUPER::', so until we have a better solution I think that probably is the way to go. -- 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=35133 --- Comment #2 from David Gustafsson <glasklas@gmail.com> --- Created attachment 157678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157678&action=edit Bug 35133: Don't lazily define accessor methods when invoked through SUPER -- 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=35133 --- Comment #3 from David Gustafsson <glasklas@gmail.com> --- I will attach a test case tomorrow, it's a shame it seems so hard to properly implement lazy accessors without resorting to this ugly fix. If someone can come up with some other suggestions that would be great. -- 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=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |glasklas@gmail.com |ity.org | -- 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=35133 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- It would be a good idea to link to the previous dev via "Depends on" or at least "See Also" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32476 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32476 [Bug 32476] Add caching for relatively expensive patron methods -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33745 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157678|0 |1 is obsolete| | --- Comment #5 from David Gustafsson <glasklas@gmail.com> --- Created attachment 157793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157793&action=edit Bug 35133: Don't lazily define accessor methods when invoked through SUPER To test: 1) Apply Bug 32476 2) Run tests in t/db_dependent/Patrons.t 3) This should produce multiple "Subroutine Koha::Patron::SUPER::dateexpiry redefined at ..." warnings 4) Apply patch 5) Run tests in t/db_dependent/Patrons.t again 6) The warnings in 3) should now no longer appear -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Matthias Le Gac <matthias.le-gac@inlibro.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=35133 Matthias Le Gac <matthias.le-gac@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157793|0 |1 is obsolete| | --- Comment #6 from Matthias Le Gac <matthias.le-gac@inlibro.com> --- Created attachment 160777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160777&action=edit Bug 35133: Don't lazily define accessor methods when invoked through SUPER To test: 1) Apply Bug 32476 2) Run tests in t/db_dependent/Patrons.t 3) This should produce multiple "Subroutine Koha::Patron::SUPER::dateexpiry redefined at ..." warnings 4) Apply patch 5) Run tests in t/db_dependent/Patrons.t again 6) The warnings in 3) should now no longer appear Signed-off-by: matthias le gac <matthias@babel.inlibro.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Phan Tung Bui <phan-tung.bui@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160777|0 |1 is obsolete| | --- Comment #7 from Phan Tung Bui <phan-tung.bui@inlibro.com> --- Created attachment 160778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160778&action=edit Bug 35133: Don't lazily define accessor methods when invoked through SUPER To test: 1) Apply Bug 32476 2) Run tests in t/db_dependent/Patrons.t 3) This should produce multiple "Subroutine Koha::Patron::SUPER::dateexpiry redefined at ..." warnings 4) Apply patch 5) Run tests in t/db_dependent/Patrons.t again 6) The warnings in 3) should now no longer appear Signed-off-by: matthias le gac <matthias@babel.inlibro.net> Signed-off-by: Phan Tung Bui <phan-tung.bui@inlibro.com> Phan Tung Bui -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch CC| |emily.lamancusa@montgomeryc | |ountymd.gov QA Contact|testopia@bugs.koha-communit |emily.lamancusa@montgomeryc |y.org |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160778|0 |1 is obsolete| | --- Comment #8 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 161152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161152&action=edit Bug 35133: Don't lazily define accessor methods when invoked through SUPER To test: 1) Apply Bug 32476 2) Run tests in t/db_dependent/Patrons.t 3) This should produce multiple "Subroutine Koha::Patron::SUPER::dateexpiry redefined at ..." warnings 4) Apply patch 5) Run tests in t/db_dependent/Patrons.t again 6) The warnings in 3) should now no longer appear Signed-off-by: matthias le gac <matthias@babel.inlibro.net> Signed-off-by: Phan Tung Bui <phan-tung.bui@inlibro.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #9 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Looks like this has been a bug in Perl since version 5.18 - https://www.perlmonks.org/?node_id=1171033 It makes sense to me to avoid adding the method reference to the symbol table when handling a SUPER call, since the reference will not work and the next call will fall back to AUTOLOAD anyway. This shouldn't have any side effects, and it passes the QA checks. Thanks for including a clear explanation in the comments, too! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33745 CC| |fridolin.somers@biblibre.co | |m Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33745 [Bug 33745] Speed up Koha::Object attribute accessors -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Not backported to 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35133 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED CC| |david@davidnind.com --- Comment #12 from David Nind <david@davidnind.com> --- No changes required to the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org