| Summary: | Koha::Object->get_from_storage should return undef if the object has been deleted | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
| Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | 1joynelson, hayleypelham, lucas, m.de.rooy, martin.renvoize |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
20.05.00, 19.11.03, 19.05.08, 18.11.14
|
|
| Circulation function: | |||
| Bug Depends on: | |||
| Bug Blocks: | 21901 | ||
| Attachments: |
Bug 24213: Add tests
Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted Bug 24213: Add tests Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted Bug 24213: Add tests Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted |
||
|
Description
Jonathan Druart
2019-12-11 08:22:41 UTC
Created attachment 96179 [details] [review] Bug 24213: Add tests Created attachment 96180 [details] [review] Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted Without this patch it fails with something like: DBIC result _type isn't of the _type Subscription at t/db_dependent/Biblio.t line 627. Test plan: - Apply the first patch (Add tests) - Confirm that they fail - Apply this patch - Confirm that the tests pass Created attachment 98175 [details] [review] Bug 24213: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 98176 [details] [review] Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted Without this patch it fails with something like: DBIC result _type isn't of the _type Subscription at t/db_dependent/Biblio.t line 627. Test plan: - Apply the first patch (Add tests) - Confirm that they fail - Apply this patch - Confirm that the tests pass Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works as expected and makes sense.. Signing off. QAing # Subtest: Bad value tests
1..3
# No tests run!
not ok 16 - No tests run for subtest "Bad value tests"
# Failed test 'No tests run for subtest "Bad value tests"'
# at t/db_dependent/Koha/Object.t line 685.
# Looks like you failed 1 test of 16.
not ok 16 - store() tests
# Failed test 'store() tests'
# at t/db_dependent/Koha/Object.t line 688.
Stumbling across this fail, but also without your patch.
(In reply to Marcel de Rooy from comment #7) > # Subtest: Bad value tests > 1..3 > # No tests run! > not ok 16 - No tests run for subtest "Bad value tests" > # Failed test 'No tests run for subtest "Bad value tests"' > # at t/db_dependent/Koha/Object.t line 685. > # Looks like you failed 1 test of 16. > not ok 16 - store() tests > # Failed test 'store() tests' > # at t/db_dependent/Koha/Object.t line 688. > > Stumbling across this fail, but also without your patch. Can be ignored. Resolved with strict_sql_mode. Maybe an idea to put this key in the default koha-conf.xml (commented or zero)? Created attachment 98203 [details] [review] Bug 24213: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 98204 [details] [review] Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted Without this patch it fails with something like: DBIC result _type isn't of the _type Subscription at t/db_dependent/Biblio.t line 627. Test plan: - Apply the first patch (Add tests) - Confirm that they fail - Apply this patch - Confirm that the tests pass Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> (In reply to Marcel de Rooy from comment #8) > (In reply to Marcel de Rooy from comment #7) > > # Subtest: Bad value tests > > 1..3 > > # No tests run! > > not ok 16 - No tests run for subtest "Bad value tests" > > # Failed test 'No tests run for subtest "Bad value tests"' > > # at t/db_dependent/Koha/Object.t line 685. > > # Looks like you failed 1 test of 16. > > not ok 16 - store() tests > > # Failed test 'store() tests' > > # at t/db_dependent/Koha/Object.t line 688. > > > > Stumbling across this fail, but also without your patch. > > Can be ignored. Resolved with strict_sql_mode. Maybe an idea to put this key > in the default koha-conf.xml (commented or zero)? I do not understand what you meant. The test passes for me, with strict_sql_mode set. When run with prove, the strict mode is enabled automatically. Also the flag is set for devs (so from koha-testing-docker), that's is expected, we want devs to catch such problems. Nice work everyone! Pushed to master for 20.05 Pushed to 19.11.x branch for 19.11.03 backported to 19.05.x for 19.05.08 Backported to 18.11.x for 18.11.14. |