Locale lookup incorrectly assumes user is event target

Bug #1986479 reported by Jeff Davis
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned

Bug Description

EG 3.9

Bug 1091588 introduced the ability to send notification emails in the user's preferred language. To determine the preferred language, the new code takes the action trigger event target and looks up the locale for that ID in actor.usr. This is a problem because the target is not necessarily an actor.usr ID -- for example, for checkout receipts, the target is an action.circulation ID. For most such events, the event will fail with an "error" state and a message like this in the logs:

Can't use an undefined value as a HASH reference at /usr/local/share/perl/5.30.0/OpenILS/Application/Trigger/Event.pm line 518.

It's also possible that the target will match an existing user ID, in which case the event won't fail but you're using the wrong user's locale.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I don't have a fix for this, but for anyone who needs events to work on 3.9, working branch user/jeffdavis/lp1986479-workaround should do that by disabling the code that looks up the preferred language. This is definitely not a solution, just a temporary mitigation.

Galen Charlton (gmc)
Changed in evergreen:
milestone: none → 3.9.1
importance: Undecided → High
status: New → Confirmed
assignee: nobody → Galen Charlton (gmc)
tags: added: actiontrigger
Revision history for this message
Galen Charlton (gmc) wrote :
tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

Also, I've pushed a follow-up to do a bit of refactoring and to remove checking for hard-coded reactors.

Revision history for this message
Galen Charlton (gmc) wrote :

Acknowledging here the contributions that Mike Rylander made to the refactoring portion.

Revision history for this message
Mike Rylander (mrylander) wrote :
tags: added: signedoff
Galen Charlton (gmc)
Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
Revision history for this message
Galen Charlton (gmc) wrote :

This has now successfully been exercised in production, so given its priority, I've merged this for inclusion in 3.9.1.

Changed in evergreen:
status: Confirmed → Fix Committed
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.