Bug 19926 - Add the Koha::Object->unblessed_all_relateds method
Summary: Add the Koha::Object->unblessed_all_relateds method
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Josef Moravec
URL:
Keywords:
Depends on:
Blocks: 17553 19935
  Show dependency treegraph
 
Reported: 2018-01-08 16:58 UTC by Jonathan Druart
Modified: 2018-12-03 20:03 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 19926: Add the Koha::Object->unblessed_all_relateds method (3.44 KB, patch)
2018-01-08 17:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds (3.18 KB, patch)
2018-01-08 17:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19926: Add the Koha::Object->unblessed_all_relateds method (3.50 KB, patch)
2018-03-13 10:11 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds (3.23 KB, patch)
2018-03-13 10:11 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
Bug 19926: Add the Koha::Object->unblessed_all_relateds method (3.55 KB, patch)
2018-04-03 12:23 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds (3.29 KB, patch)
2018-04-03 12:23 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-01-08 16:58:15 UTC
In order to refactor our legacy code step-by-step, we will need to provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to deprecate the existing syntax in order to support only one syntax. Currently we fetch all the values from the related tables, without knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds method which will return a hash containing all the fields from the related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues for instance, they are used to send notices and so we have to provide all the data needed.
Comment 1 Jonathan Druart 2018-01-08 17:00:21 UTC
Created attachment 70327 [details] [review]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method

In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.

See dependent bugs to understand the context and test this patch.
Comment 2 Jonathan Druart 2018-01-08 17:00:26 UTC
Created attachment 70328 [details] [review]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds
Comment 3 Benjamin Rokseth 2018-03-13 10:11:19 UTC
Created attachment 72764 [details] [review]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method

In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.

See dependent bugs to understand the context and test this patch.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Comment 4 Benjamin Rokseth 2018-03-13 10:11:31 UTC
Created attachment 72765 [details] [review]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Comment 5 Benjamin Rokseth 2018-03-13 10:11:56 UTC
Great work Jo!
Comment 6 Josef Moravec 2018-04-03 12:23:06 UTC
Created attachment 73552 [details] [review]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method

In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.

The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.

I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.

See dependent bugs to understand the context and test this patch.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2018-04-03 12:23:09 UTC
Created attachment 73553 [details] [review]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Jonathan Druart 2018-04-03 14:49:30 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 9 Nick Clemens (kidclamp) 2018-05-14 14:36:44 UTC
Enhancement, not backporting to 17.11.x