Similarly to notices when a booking has been modified or deleted we should have a notice for a successful creation of a booking for patrons.
I stumbled on the bug description a little - hope this is OK?
Sure, you are right. Copied it from Bug 37204 and doctored it a bit too much.
Created attachment 170933 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully
Created attachment 170934 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully To test: 1) Apply the patch 2) Include the sample notice, e.g. run 'reset_all' on ktd 3) Create a booking 4) Look into the borrower notifications 5) Confirm the notice has been generated 6) Run t/db_dependent/Koha/Booking.t
Created attachment 170935 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully To test: 1) Apply the patch 2) Include the sample notice, e.g. run 'reset_all' on ktd 3) Create a booking 4) Look into the borrower notifications 5) Confirm the notice has been generated 6) Run t/db_dependent/Koha/Booking.t
Commented the 'Obsoletes' for some reason the first time. Please ignore :D
Created attachment 171066 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully To test: 1) Apply the patch 2) Include the sample notice, e.g. run 'reset_all' on ktd 3) Create a booking 4) Look into the borrower notifications 5) Confirm the notice has been generated 6) Run t/db_dependent/Koha/Booking.t Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
I just inserted the signed-off line because the sandbox failed at that step. Just for reference.
Created attachment 172829 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully To test: 1) Apply the patch 2) Include the sample notice, e.g. run 'reset_all' on ktd 3) Create a booking 4) Look into the borrower notifications 5) Confirm the notice has been generated 6) Run t/db_dependent/Koha/Booking.t Signed-off-by: LEBSimonsen <simonsen@bz-sh.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
More great work, thanks.
Created attachment 173286 [details] [review] Bug 37803: Add patron notification when a new booking has been created successfully To test: 1) Apply the patch 2) Include the sample notice, e.g. run 'reset_all' on ktd 3) Create a booking 4) Look into the borrower notifications 5) Confirm the notice has been generated 6) Run t/db_dependent/Koha/Booking.t Signed-off-by: LEBSimonsen <simonsen@bz-sh.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Pushed for 24.11! Well done everyone, thank you!
Enhancement, no 24.05.x backport
Notice template not created for existing installations, is that expected?
(In reply to Jonathan Druart from comment #14) > Notice template not created for existing installations, is that expected? Koha_Main_My8 is failing with: 18:55:44 koha_1 | No bookings BOOKING_CONFIRMATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610. 18:55:44 koha_1 | 18:55:44 koha_1 | # Failed test 'Koha::Booking->store should have enqueued a BOOKING_CONFIRMATION email for a new booking' 18:55:44 koha_1 | # at t/db_dependent/Koha/Booking.t line 413. 18:55:44 koha_1 | # got: '0' 18:55:44 koha_1 | # expected: '1' 18:55:44 koha_1 | # Looks like you failed 1 test of 2. 18:55:44 koha_1 | 18:55:44 koha_1 | # Failed test 'confirmation notice trigger' 18:55:44 koha_1 | # at t/db_dependent/Koha/Booking.t line 418. 18:55:44 koha_1 | No bookings BOOKING_CONFIRMATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610. 18:55:44 koha_1 | No bookings BOOKING_MODIFICATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610. 18:55:44 koha_1 | 18:55:44 koha_1 | # Failed test 'Koha::Booking->store should have enqueued a BOOKING_MODIFICATION email for a booking with modified start_date' 18:55:44 koha_1 | # at t/db_dependent/Koha/Booking.t line 495. 18:55:44 koha_1 | # got: '0' 18:55:44 koha_1 | # expected: '1' 18:55:44 koha_1 | No bookings BOOKING_MODIFICATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610. 18:55:44 koha_1 | No bookings BOOKING_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610. 18:55:44 koha_1 | 18:55:44 koha_1 | # Failed test 'Koha::Booking->store should have enqueued a BOOKING_CANCELLATION email for a booking status change that is a "cancellation"' 18:55:44 koha_1 | # at t/db_dependent/Koha/Booking.t line 537. 18:55:44 koha_1 | # got: '0' 18:55:44 koha_1 | # expected: '1' 18:58:14 koha_1 | # Looks like you failed 2 tests of 5. 18:58:14 koha_1 | 18:58:14 koha_1 | # Failed test 'modification/cancellation notice triggers' 18:58:14 koha_1 | # at t/db_dependent/Koha/Booking.t line 542. 18:58:14 koha_1 | DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'status' at row 1 at /kohadevbox/koha/Koha/Object.pm line 172 18:58:14 koha_1 | # Looks like you failed 2 tests of 16. 18:58:14 koha_1 | 18:58:14 koha_1 | # Failed test 'store() tests' 18:58:14 koha_1 | # at t/db_dependent/Koha/Booking.t line 558. 18:58:14 koha_1 | # Looks like you failed 1 test of 2. 18:58:14 koha_1 | [17:52:23] t/db_dependent/Koha/Booking.t The template is missing because we are running the tests suite after update DB process, not a "normal" installation (using selenium tests, like in Koha_Main) Jenkins config has `export TEST_DB_UPGRADE=yes`
(In reply to Jonathan Druart from comment #14) > Notice template not created for existing installations, is that expected? Yes, it was to be expected to keep the behavior consistent for updating installations ("lest surprise") and because libraries will need/want to adapt the notices before starting to send them. I am quite sure this is not the only notice we handled it that way.