koha@kohacommunity:~/kohaclone$ perl t/db_dependent/Letters.t 1..81 ok 1 - use C4::Context; ok 2 - use C4::Members; ok 3 - use C4::Acquisition; ok 4 - use C4::Biblio; ok 5 - use C4::Letters; Can't call method "get_expiry_date" on an undefined value at /home/koha/kohaclone/C4/Members.pm line 465. # Looks like your test exited with 7 just after 5. Problem is at line: my $patron_category = $builder->build({ source => 'Category' }); Change to: my $patron_category = $builder->build({ source => 'Category' })->{categorycode};
Created attachment 62689 [details] [review] Bug 18494: Fix Letters.t (follow-up of 5260) koha@kohacommunity:~/kohaclone$ perl t/db_dependent/Letters.t 1..81 ok 1 - use C4::Context; ok 2 - use C4::Members; ok 3 - use C4::Acquisition; ok 4 - use C4::Biblio; ok 5 - use C4::Letters; Can't call method "get_expiry_date" on an undefined value at /home/koha/kohaclone/C4/Members.pm line 465. Looks like your test exited with 7 just after 5. Problem is at line: my $patron_category = $builder->build({ source => 'Category' }); Change to: my $patron_category = $builder->build({ source => 'Category' })->{categorycode}; To test: 1. Before applying patch, run t/db_dependent/Letters.t 2. Observe above failure 3. Apply patch 4. Run t/db_dependent/Letters.t 5. Watch it pass
Now that I'm looking at this closer, I don't yet understand why it originally fails. If $patron_category is passed as a hashref to ->find, I'm thinking it should still work... I tested it on another container running with slightly different version and I don't experience this failure.
Ah it seems it's broken by Bug 15702 and not Bug 5260. Sorry!
Created attachment 62706 [details] [review] Bug 18494: Fix Letters.t (follow-up of 15702) koha@kohacommunity:~/kohaclone$ perl t/db_dependent/Letters.t 1..81 ok 1 - use C4::Context; ok 2 - use C4::Members; ok 3 - use C4::Acquisition; ok 4 - use C4::Biblio; ok 5 - use C4::Letters; Can't call method "get_expiry_date" on an undefined value at /home/koha/kohaclone/C4/Members.pm line 465. Looks like your test exited with 7 just after 5. This is caused by the new trimming functionality in AddMember when categorycode is passed as a HASHref. Before trimming, make sure that the value is not a ref. To test: 1. perl t/db_dependent/Letters.t 2. Observe above failure 3. Apply patch 4. Watch it pass
Created attachment 62707 [details] [review] Bug 18494: Fix Letters.t (follow-up of 15702) koha@kohacommunity:~/kohaclone$ perl t/db_dependent/Letters.t 1..81 ok 1 - use C4::Context; ok 2 - use C4::Members; ok 3 - use C4::Acquisition; ok 4 - use C4::Biblio; ok 5 - use C4::Letters; Can't call method "get_expiry_date" on an undefined value at /home/koha/kohaclone/C4/Members.pm line 465. Looks like your test exited with 7 just after 5. This is caused by the new trimming functionality in AddMember when categorycode is passed as a HASHref. Before trimming, make sure that the value is not a ref. To test: 1. perl t/db_dependent/Letters.t 2. Observe above failure 3. Apply patch 4. Watch it pass 5. Also prove t/db_dependent/Members.t
Created attachment 62749 [details] [review] Bug 18494: Fix Letters.t (follow-up of 15702) koha@kohacommunity:~/kohaclone$ perl t/db_dependent/Letters.t 1..81 ok 1 - use C4::Context; ok 2 - use C4::Members; ok 3 - use C4::Acquisition; ok 4 - use C4::Biblio; ok 5 - use C4::Letters; Can't call method "get_expiry_date" on an undefined value at /home/koha/kohaclone/C4/Members.pm line 465. Looks like your test exited with 7 just after 5. This is caused by the new trimming functionality in AddMember when categorycode is passed as a HASHref. Before trimming, make sure that the value is not a ref. To test: 1. perl t/db_dependent/Letters.t 2. Observe above failure 3. Apply patch 4. Watch it pass 5. Also prove t/db_dependent/Members.t NOTE: Oops! Thanks for the fix. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
As this bug is marked as a follow up of 15702, I did not fail it, when line 299 failed because it crossed the second boundary on the biblio timestamp. Re-running succeeded with no second boundary crossed.
(In reply to Lari Taskula from comment #2) > Now that I'm looking at this closer, I don't yet understand why it > originally fails. If $patron_category is passed as a hashref to ->find, I'm > thinking it should still work... I tested it on another container running > with slightly different version and I don't experience this failure. Passing categorycode as a hashref seems to be wrong. Why are we fixing this error in the wrong place ? Please convince me before passing qa on this one.
(In reply to Lari Taskula from comment #2) > Now that I'm looking at this closer, I don't yet understand why it > originally fails. If $patron_category is passed as a hashref to ->find, I'm > thinking it should still work... I tested it on another container running > with slightly different version and I don't experience this failure. Because the builder returns a hash code, when the patron_category is supposed to be a scalar. The solution in comment #0 is correct.
(In reply to Lari Taskula from comment #2) > I don't yet understand why it originally fails. Also, there was a double comma. Wrong number of commas do weird things!
Created attachment 62926 [details] [review] Bug 18494: Pass a code, not hash & Fix double commas TEST PLAN --------- 1) prove -v t/db_dependent/Letters.t -- fails at test 5 or so. 2) apply patch 3) run step 1 -- success 4) run koha qa test tools
DO NOT APPLY BOTH! The second one is my counter-patch. If that is acceptable. obsolete the first and sign off the second.
Created attachment 62954 [details] [review] Bug 18494: Pass a code, not hash & Fix double commas TEST PLAN --------- 1) prove -v t/db_dependent/Letters.t -- fails at test 5 or so. 2) apply patch 3) run step 1 -- success 4) run koha qa test tools Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to M. Tompsett from comment #12) > If that is acceptable. obsolete the first and sign off the second. Counter patch is a trivial one. Passing QA immediately. First patch obsoleted. If there is a need for it, please open a new report.
Just noticed that my patch is identical to Lari's first obsoleted patch. Feel free to change author to Lari instead.
Pushed to master for 17.05, thanks Mark!
This patch has been pushed to 16.11.x and will be in 16.11.08.
Pushed to 16.05.x, for 16.05.13 release