Emailing Bib Records from the catalog (staff and OPAC) reports success, but fails to send email

Bug #1955079 reported by Michele Morgan
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.10
Fix Released
High
Unassigned
3.8
Fix Released
High
Unassigned

Bug Description

Evergreen 3.6.4

When the opac options to email bib records is chosen, the user sees a preview of the email, but when the "Email now" option is selected, the email message is never generated.

This affects emailing individual bib records as well as emailing records from a basket or list.

Looking in the database, an action trigger event is created for the Preview for the email, but no subsequent event is created to send the actual message.

Revision history for this message
Garry Collum (gcollum) wrote :

Confirmed in 3.7.2

Changed in evergreen:
status: New → Confirmed
tags: added: opac
Revision history for this message
Terran McCanna (tmccanna) wrote :

Bumping this to High since it directly affects patrons using the OPAC.

Changed in evergreen:
importance: Undecided → High
Michele Morgan (mmorgan)
summary: - Emailing Bib Records from the OPAC fails
+ Emailing Bib Records from the catalog (staff and OPAC) reports success,
+ but fails to send email
Revision history for this message
Michele Morgan (mmorgan) wrote :

This affects staff also and can lead to patrons or staff carefully curating a basket of records, choosing to send them via email, seeing confirmation that the email is queued for delivery, and losing their work as the email never arrives.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Adding a note that Emailing is also failing in the angular staff catalog. Just reproduced this on demo.evergreencatalog.com.

Selecting bibs for a basket, and choosing Email Title Details under Basket Actions results in this console error:

ERROR Error: Uncaught (in promise): open-ils.search.biblio.record.email failed! stat=500 msg= *** Call to [open-ils.search.biblio.record.email] failed for session [0.447598980395788051641921240361], thread trace [0]:
Modification of non-creatable array value attempted, subscript -3 at /usr/local/share/perl/5.24.1/OpenILS/Application/Search/Biblio.pm line 2033.

    at T (polyfills.9b26e9b6c6d2049cc2b1.js:1)
    at polyfills.9b26e9b6c6d2049cc2b1.js:1
    at l._error (main.8224bc24f26fd2140d2a.js:1)
    at l.__tryOrUnsub (main.8224bc24f26fd2140d2a.js:1)
    at l.error (main.8224bc24f26fd2140d2a.js:1)
    at u._error (main.8224bc24f26fd2140d2a.js:1)
    at u.error (main.8224bc24f26fd2140d2a.js:1)
    at OpenSRF.Request.onmethoderror (main.8224bc24f26fd2140d2a.js:1)
    at Function.OpenSRF.Stack.handle_message (opensrf.js:731)
    at Function.OpenSRF.Stack.push (opensrf.js:693)

Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Adam Bowling (abowling) wrote :

Per Michele's post, that indicates that Perl is receiving an array that is shorter than the offset or length settings require.

This is the line in question in /usr/local/share/perl/5.24.1/OpenILS/Application/Search/Biblio.pm:

($captcha_pass, $email, $subject) = splice @_, -3, 3;

Revision history for this message
Mike Rylander (mrylander) wrote :

I've pushed a branch that addresses the staff catalog issue at https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp1955079-ang-email-records-fix

The OPAC issue remains unaddressed for now.

Revision history for this message
Michele Morgan (mmorgan) wrote :

We are running this patch on our production system and it fixes the issue for staff.

But the functionality is lost for patrons. We've had to hide the email options in the opac until this is resolved.

Revision history for this message
Jane Sandberg (sandbergja) wrote (last edit ):

I ran into this bug the other day as a patron! :-)

Email::Simple is definitely mangling the headers of emails sent from the OPAC (similar to bug 1801163, which Jason S, Galen, and Jason B fixed).

Here is a branch which signs off on Mike's fix, moves the OPAC mailing to Email::MIME, and adds some tests: user/sandbergja/lp1955079_email_records_fix

Here's a link: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1955079_email_records_fix

Adding pullrequest to get more eyes on this, but please note that I have only tested in my local dev setup; this still should be tested on a real server that sends real emails before getting merged.

tags: added: pullrequest
Revision history for this message
Gina Monti (gmonti90) wrote :

Testing this for Bug Squash 07/2022 on the Equinox test server. When I log in with an account with an email set up and click on 'Email' in the record details (OPAC side), an error shows up in the preview area: "ACTION_TRIGGER_EVENT_DEFINITION_NOT_FOUND /'

Not sure if there is anything else that needs to be done on the test server before proceeding.

Revision history for this message
Jason Boyer (jboyer) wrote :

Sorry about that Gina, I had disabled all email / sms triggers and then only enabled 1 when I should have enabled a couple more. If you try again this should work.

Revision history for this message
Eva Cerninakova (ece) wrote :

I tested sending an email from OPAC using an account with patron permission and with cataloger permission, and from the staff catalog using the same patron account with cataloger permission.

I didn't receive any email sent from the staff catalog using the "Basket Actions"

Sending bibliographic information from OPAC basically works in all cases, i.e.
- when sending email, using the "Email" options in the record details screen
- when sending email, using the "Email Title Details" option after clicking on the basket icon
- when viewing the basket and then using the "Email Title details" option

Identified issues:
1. If the record contains non-Latin characters, e.g. the author's name in Japanese (see record 206), the email is not sent, regardless of whether the email is sent using a link directly in the record or is sent from the basket.

2. After checking the box "Clear entire basket when the above action is complete" and after sending the email, the basket will not be cleared, regardless of whether the "Email title Details" option is selected after clicking on the basket icon or whether the "View Basket" and then "Email Title Details" is used.

3. Inconsistent behavior of Update button in relation to individual field of the form:
- When changing most values (Email address, Subject, Sorting, etc.), it is necessary to click the button "Update" i to save the submitted value.
- When values in the Format field are changed, it is not necessary to update the form - full or brief format are applied to the email sent just by changing the value in the form.
Note: at firs I was confused, what does the Update button do at all. Maybe an icon with help would be useful here.

4. When sending the e-mail from Basket View, after sending email it is impossible to return to the screen preceding the Basket using the browser "history arrow". It is only possible to list the preceding page in the list of pages in browser history

Example scenario:
Add item to basket from the search result screen
Click on Basket and choose View Basket
Click on the button" Email Details "
Click on the button "Email Now"
Click on the button "Return" on the screen with confirmation saying "Your email has been queued for delivery ..."
Then click on the browser history arrow on the top bar of the browser - It is not possible to return to the result screen.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Removing the pullrequest due to the remaining issues in comment #12

tags: added: needswork
removed: pullrequest
Revision history for this message
Gina Monti (gmonti90) wrote :

Sorry! I forgot to mention that I can confirm the email situation didn't work out for me either, but it was simply from trying to send a bib via item details page. It did say 'success' but I didn't receive one.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote (last edit ):

I pushed a rebased version of Mike's commit and my commit to the same branch: user/sandbergja/lp1955079_email_records_fix

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
tags: added: pullrequest
removed: needswork
Revision history for this message
Jane Sandberg (sandbergja) wrote :

I think this branch is ready for review again. I did address the issue #1 from Eva's comment (non-Latin characters causing email sending to fail). I didn't address #2-4, though they are important. I think those would be more easily addressed as separate issues.

A few notes for testing:
* Make sure that you are testing from a server that is configured to send email, or use these steps to test it locally in a dev environment: https://wiki.evergreen-ils.org/doku.php?id=dev:email -- thanks to Bill Erickson, Jason Stephenson, and Chris Sharp for the guidance on setting this up locally!
* For the staff basket emails to send, you must have the action trigger runner running regularly, or manually run `/openils/bin/action_trigger_runner.pl --run-pending` after you trigger the email from the staff catalog

Changed in evergreen:
milestone: none → 3.9.1
Revision history for this message
Garry Collum (gcollum) wrote :

I tested on a vm running a local mail server and I was able to email a bib and a list to opensrf@localhost. It worked great. A signed-off branch is at https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/gcollum/lp1955079_email_records_fix-signoff

tags: added: signedoff
Revision history for this message
Garry Collum (gcollum) wrote :

I also tested with non-latin characters. (Records 105, 187) in Concerto. The email was received, but the non-latin characters were mangled - Content Type: Text plain; charset=UTF-8.

Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Garry Collum (gcollum) wrote :

I opened https://bugs.launchpad.net/evergreen/+bug/1995510 to address Eva's 3rd comment.

Changed in evergreen:
milestone: 3.9.1 → 3.9.2
Revision history for this message
Michele Morgan (mmorgan) wrote :

This patch restores the email bib records functionality to both the opac and staff client.

Pushed to master and back to rel_3_8

To address Eva's and Garry's comments:

1. Emailing bibs with Non-latin characters - opened bug 2002338

2. Failure to clear the basket is addressed by existing bugs:

bug 1788485
bug 1894906
bug 1788467
bug 1928002

3. Email form behavior has been moved to bug 1995510

4. Returning to search results after emailing works as I would expect. When choosing to email from the Basket Actions dropdown on the search results page, Return brings me back to the search results page. When choosing to email from the View Basket page, Return brings me back to the Veiw Basket page.

Big Thanks to Jane, Garry and all who tested!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Michele Morgan (mmorgan) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.