https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15759
Bug ID: 15759
Summary: Allow Koha::Object derived objects to be used as
hashrefs
Change sponsored?: ---
Product: Koha
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
On occasion, bugs in Koha have been revealed to be a mis-use of Koha::Object.
This seems to be due to our long standing use of hashrefs for data in Koha.
For instance, a developer may accidentally write:
my $borrowernumber = $borrower->{borrowernumber};
instead of
my $borrowernumber = $borrower->borrowernumber;
Since our object is a blessed hashref, this does not cause an error. Instead,
we just access that key of the hashref, which is almost certainly undefined.
With some extra code in Koha/Object.pm, we can allow hashref-like use of our
Objects, which will not only prevent these errors, but allow drop-in use of
Koha::Objects where we currently use hashrefs!
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/