Koha::Objects should raise exceptions when invalid accessors are called, and when invalid properties are updated using ->set.
Created attachment 56168 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests.
Created attachment 56169 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests.
Created attachment 56170 [details] [review] Bug 17425: Add Try::Tiny dependency This patch just introduces Try::Tiny as a core Koha dependency.
Created attachment 56187 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests. Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 56188 [details] [review] Bug 17425: Add Try::Tiny dependency This patch just introduces Try::Tiny as a core Koha dependency. Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 56218 [details] Bug 17425 Try::Tiny Control file update (master)
Created attachment 56220 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 56221 [details] [review] Bug 17425: Add Try::Tiny dependency This patch just introduces Try::Tiny as a core Koha dependency. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
After Bug 17226 Applying: Bug 17425: Make Koha::Object raise exceptions Using index info to reconstruct a base tree... M Koha/Object.pm Falling back to patching base and 3-way merge... error: The following untracked working tree files would be overwritten by merge: Koha/Exceptions/Object.pm Please move or remove them before you can merge. Aborting Failed to merge in the changes. Patch failed at 0001 Bug 17425: Make Koha::Object raise exceptions
Please rebase
Created attachment 56393 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 56394 [details] [review] Bug 17425: Add Try::Tiny dependency This patch just introduces Try::Tiny as a core Koha dependency. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 56395 [details] [review] Bug 17425: Add the Object::MethodNotCoveredByTests exception
Tomas, please have a look at the third patch.
Created attachment 56459 [details] [review] Bug 17425: Make Koha::Object raise exceptions This patch makes Koha::Object raise exceptions in the following situations: - When a non existent accessor is called - When a non existent property is tried to be updated using ->set On implementing this change, we introduce Koha::Exceptions::Object class to contain all Koha::Object-specific exception definitions. Unit tests for this change are introduced in t/db_dependent/Koha/Objects.t To test: - Apply the patches on master - Run: $ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests return green - Sign off Note: A followup introduces the dependency for Try::Tiny. It needs to be present for running the tests. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 56460 [details] [review] Bug 17425: Add Try::Tiny dependency This patch just introduces Try::Tiny as a core Koha dependency. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 56461 [details] [review] Bug 17425: Add the Object::MethodNotCoveredByTests exception Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 16.11, thanks Tomas, Jonathan!
Ubuntu 14.04 has libtry-tiny-perl 0.19-1. Can we lower the dependency min version?
(In reply to Mirko Tietgen from comment #19) > Ubuntu 14.04 has libtry-tiny-perl 0.19-1. Can we lower the dependency min > version? Mirko, can you file new bug reports for these requests? If you can supply the patch as well that should help us move it along! If we want to do that for 16.11, we need to move fast!
Kyle, I'd drop the idea. It does not make sense to support 14.04 when we drop Wheezy support.
(the thinking was if it is possible to support 14.04 while 16.04 has still problems with mysql 5.7, but as mariadb is a working alternative, I don't care about 14.04)