LP#1896070: ensure that deatching course material doesn't delete non-temporary bibs user/gmcharlt/lp1896070_fix_course_material_detachment
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 17 Sep 2020 14:44:01 +0000 (10:44 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 17 Sep 2020 14:45:26 +0000 (10:45 -0400)
commitd5b08719d7535bc8e36090209d511eb26e523ded
treec5a5ce82eead31be7d31aeab4ed22d53e40ef324
parentcbcacba5202fb7ededf65cff10fd86f874b20c24
LP#1896070: ensure that deatching course material doesn't delete non-temporary bibs

This patch fixes how the temporary_record field is checked; in Perl code,
non-NULL Boolean fields in Fieldmapper objects do /not/ evaluate as
Perl Boolean values; you have to use $U->is_true() or explictly
compare against 't' and 'f'.

This patch also tweaks live_t/31-courses.t so that it can be run
repeatedly.

To test
-------
[1] Run live_t/31-courses.t repeatedly; note that it will start failing
    the second time.
[2] Reset the database and apply the patch, then repeat step 1.
[3] This time, the test should work when run repeatedly.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Courses.pm
Open-ILS/src/perlmods/live_t/31-courses.t