Description
Jonathan Druart
2018-01-08 16:58:15 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. Created attachment 70328 [details] [review] Bug 19926: Add tests for Koha::Object->unblessed_all_relateds 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> Created attachment 72765 [details] [review] Bug 19926: Add tests for Koha::Object->unblessed_all_relateds Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Great work Jo! 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> 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> Pushed to master for 18.05, thanks to everybody involved! Enhancement, not backporting to 17.11.x |