https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42501

--- Comment #5 from Andrii Nugged <[email protected]> ---
Created attachment 211496
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211496&action=edit
Bug 42501: Prepare all partner emails before queueing

Queueing while preparing the selected partners can leave the first
email pending when a later language has a missing or blank draft or
notice template. The request reports failure despite that queued email.

Prepare all selected letters first. Return the normal browser error
before any queue write if a recipient, template, subject or message is
unusable. Keep the existing language drafts and edited text. Suppress
the misleading "No partners have been defined yet" message on failure.

Regression tests cover missing and whitespace-only fields, a missing
notice, a notice preparation exception and a missing recipient after
a valid partner. Each must return an error, queue nothing and leave
the request status unchanged.

Test plan:
Use a test system with outgoing email disabled. Apply the earlier patches
on this bug. Enable ILLModule and TranslateNotices. Have two ILL partner
patrons with email addresses and different preferred notice languages,
and an ILL_PARTNER_REQ email template for each language. The staff
library must have an email address.

Before applying the patch:
1. Open a new ILL request in Interlibrary loans.
2. Click "Place request with partners".
3. Select both partner libraries.
4. Replace the second language's "Email text" with spaces only.
5. Click "Send email". An "Email queueing failed" error appears.
6. Open the first partner's patron record, then "Notices". Its email
   has nevertheless been queued with status "pending".

Apply the patch.

After applying the patch:
1. Repeat steps 1-5 with a fresh new request. The error now says no
   emails have been queued.
2. Check both partners' "Notices". Neither has an additional email.
3. Open "Place request with partners" again for the new request.
4. Select both partners and enter a nonblank subject and text for each.
5. Deselect and reselect one partner. Its edited text is preserved.
6. Click "Send email". The request is "Requested from partners".
7. Check both partners' "Notices". Each has one new pending email
   with its own language's edited subject and text.

Automated tests:
prove -I. -It/lib t/db_dependent/Koha/ILL/PartnerLanguages.t
prove -I. -It/lib t/db_dependent/Koha/ILL/Requests.t

Co-Authored-By: Loontik <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to