Triggered events get confused when actor.usr.*_address = org_unit.*_address

Bug #1073905 reported by Michael Peters
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.2
Won't Fix
Medium
Unassigned
2.3
Fix Released
Medium
Unassigned
2.4
Fix Released
Medium
Unassigned

Bug Description

Evergreen 2.2.2

We're seeing with many triggered events a problem when a user's address is the same as an org unit's. They end up with the OU address printed on the notice, NOT their proper mailing address. Took me a while to catch this, but I have now, and I think it's bug worthy since it's happening across multiple types of notices.

Data:

evergreen=# SELECT mailing_address, billing_address FROM actor.usr WHERE id IN (SELECT usr FROM actor.card WHERE barcode='23946000558665' OR barcode='23946000335080');
mailing_address | billing_address
----+-----------------
181 | 181
181 | 181
(2 rows)

evergreen=# SELECT * FROM actor.org_address WHERE id=181;
id | valid | address_type | org_unit | street1 | street2 | city | county | state | country | post_code | san
-----+-------+--------------+----------+-----------------------+---------+------------+--------+-------+---------+-----------+-----
181 | t | MAILING | 115 | 125 S FRANKLIN STREET | | BLOOMFIELD | | IN | US | 47424 |
(1 row)

evergreen=# SELECT * FROM actor.usr_address WHERE id=181;
id | valid | within_city_limits | address_type | usr | street1 | street2 | city | county | state | country | post_code | pending | replaces
-----+-------+--------------------+-------------------+-------+----------------+---------+------------+--------+-------+---------+-----------+---------+----------
181 | t | t | Legacy Address #1 | 15285 | 945 MAXWELL LN | | ZIONSVILLE | | IN | US | 46077 | f |
(1 row)

Template Output Snippet:

<patron>
    <barcode>1234</barcode>
    <first_given_name>JIM</first_given_name>
    <family_name>JONES</family_name>
    <addr_street1>125 S FRANKLIN STREET</addr_street1>
    <addr_street2></addr_street2>
    <addr_city>BLOOMFIELD</addr_city>
    <addr_state>IN</addr_state>
    <addr_post_code>47424</addr_post_code>
    <email><email address hidden></email>
    <sys_id>15285</sys_id> +
</patron>

Revision history for this message
Michael Peters (mrpeters) wrote :

Template attached

Revision history for this message
Michael Peters (mrpeters) wrote :

Config tables

Revision history for this message
Thomas Berezansky (tsbere) wrote :
tags: added: pullrequest
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Ben Shum (bshum)
Changed in evergreen:
milestone: none → 2.4.0-rc
Ben Shum (bshum)
Changed in evergreen:
milestone: 2.4.0-rc → none
Ben Shum (bshum)
Changed in evergreen:
milestone: none → 2.5.0-m1
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-m1 → 2.5.0-m2
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-m2 → 2.5.0-alpha1
Revision history for this message
Ben Shum (bshum) wrote :

Marking as "won't fix" for 2.2 because we are outside the 2.2 support timeframe for non-security bug fixes.

Remington Steed (rjs7)
Changed in evergreen:
milestone: 2.5.0-alpha1 → 2.5.0-alpha2
Revision history for this message
Mike Rylander (mrylander) wrote :

Thanks, Thomas. It's sane and in.

Changed in evergreen:
status: Confirmed → Fix Committed
Ben Shum (bshum)
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.