Created attachment 173648 [details] [review] Bug 38287: Add missing rule_value access Test plan: 1) Access circuation rules: http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl 2) Scroll down to "Default checkout, hold and return policy". Enter nothing. Hit 'Save'. 3) Notice on page reload there is a Koha:: object on the bookings inputs 4) Save again -> ERROR 5) Apply patch. Repeat.
Created attachment 173649 [details] [review] Bug 38287: Clean-up unecessary input values These are inputs for new entries, no values are shown or needed here
Created attachment 173681 [details] [review] Bug 38287: Add missing rule_value access Test plan: 1) Access circuation rules: http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl 2) Scroll down to "Default checkout, hold and return policy". Enter nothing. Hit 'Save'. 3) Notice on page reload there is a Koha:: object on the bookings inputs 4) Save again -> ERROR 5) Apply patch. Repeat. Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Created attachment 173682 [details] [review] Bug 38287: Clean-up unecessary input values These are inputs for new entries, no values are shown or needed here Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Created attachment 173743 [details] [review] Bug 38287: Add missing rule_value access Test plan: 1) Access circuation rules: http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl 2) Scroll down to "Default checkout, hold and return policy". Enter nothing. Hit 'Save'. 3) Notice on page reload there is a Koha:: object on the bookings inputs 4) Save again -> ERROR 5) Apply patch. Repeat. Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 173744 [details] [review] Bug 38287: Clean-up unecessary input values These are inputs for new entries, no values are shown or needed here Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
I wonder if we are quite there yet here. I had added a rule leaving one field empty, but now the tests fail. Can you please check, Martin? Maybe there is more needed here. # Failed test 'Koha::Item->find_booking returns undefined when the current booking is cancelled and the future booking is out of range' # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3022. # got: 'Koha::Booking=HASH(0x55691b45d918)' # expected: undef # Failed test 'Koha::Item->find_booking returns undefined when the current booking is deleted and the future booking is out of range and there's no lead period rule' # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3040. # got: 'Koha::Booking=HASH(0x55691b30fc00)' # expected: undef # Looks like you failed 1 test of 3. # Failed test 'Preparation period handling' # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3074. # Looks like you failed 2 tests of 8.
(In reply to Katrin Fischer from comment #7) > I wonder if we are quite there yet here. I had added a rule leaving one > field empty, but now the tests fail. Can you please check, Martin? Maybe > there is more needed here. > > # Failed test 'Koha::Item->find_booking returns undefined when the > current booking is cancelled and the future booking is out of range' > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3022. > # got: 'Koha::Booking=HASH(0x55691b45d918)' > # expected: undef > > # Failed test 'Koha::Item->find_booking returns undefined when the > current booking is deleted and the future booking is out of range and > there's no lead period rule' > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3040. > # got: 'Koha::Booking=HASH(0x55691b30fc00)' > # expected: undef > # Looks like you failed 1 test of 3. > > # Failed test 'Preparation period handling' > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3074. > # Looks like you failed 2 tests of 8. This does not seem related. Tests pass for me before and applying the patches here.
(In reply to Pedro Amorim from comment #8) > (In reply to Katrin Fischer from comment #7) > > I wonder if we are quite there yet here. I had added a rule leaving one > > field empty, but now the tests fail. Can you please check, Martin? Maybe > > there is more needed here. > > > > # Failed test 'Koha::Item->find_booking returns undefined when the > > current booking is cancelled and the future booking is out of range' > > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3022. > > # got: 'Koha::Booking=HASH(0x55691b45d918)' > > # expected: undef > > > > # Failed test 'Koha::Item->find_booking returns undefined when the > > current booking is deleted and the future booking is out of range and > > there's no lead period rule' > > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3040. > > # got: 'Koha::Booking=HASH(0x55691b30fc00)' > > # expected: undef > > # Looks like you failed 1 test of 3. > > > > # Failed test 'Preparation period handling' > > # at /kohadevbox/koha/t/db_dependent/Koha/Item.t line 3074. > > # Looks like you failed 2 tests of 8. > > This does not seem related. Tests pass for me before and applying the > patches here. You need to add data, not just run the tests. With the patch applied, add a rule that leaves these fields empty. Before the patch, the rule would not save, but now it does. Run the test after.
(In reply to Katrin Fischer from comment #9) > > You need to add data, not just run the tests. > With the patch applied, add a rule that leaves these fields empty. > Before the patch, the rule would not save, but now it does. > Run the test after. I'm sorry, still can't reproduce. $ prove t/db_dependent/Koha/Item.t This is always passing for me. Before and after applying patch. Before and after adding "Default checkout, hold and return policy" with empty values for bookings input and different values for "Hold policy" and "Hold pickup library match". I'm clearly missing something, can you please clarify further. I want to understand how changes to a .tt file would break (or cause any change) to a Koha class .t tests file.
I've retested and I can't replicate the error now. Maybe it was resolved by some of the other bookings work pushed? What I was thinking is: * Before the patch you are prevented from adding empty cells (they don't save) * After the patch they can be saved. * So I had assumed that the data was breaking the test as we have no validation for these fields. I have filed a separate bug asking for validation as you can currently also add "a" as a value. (bug 38308)
Pushed for 24.11! Well done everyone, thank you!