A/T ApplyPatronPenalty reactor misreads environment

Bug #1859502 reported by Jason Etheridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
3.6
Fix Released
Undecided
Unassigned

Bug Description

In the handler for ApplyPatronPenalty.pm, we have:

    my $user = $$env{environment}{user};
    my $context_org = $$env{environment}{context_org};

It should be:

    my $user = $$env{user};
    my $context_org = $$env{context_org};

user and context_org are labels for their corresponding environment path entries.

I'll throw a patch up once LP gives me a bug number.

Revision history for this message
Jason Etheridge (phasefx) wrote :

There was also a typo that this patch fixes:

collab/phasefx/lp1859502-ApplyPatronPenalty @ working/Evergreen.git

    To test this, you could create the following A/T definition:

        Owning Library: CONS
        Name: test lp1859502
        Hook: penalty.PATRON_EXCEEDS_FINES
        Enabled: True
        Processing Delay: 00:00:00
        Processing Group Context Field: usr
        Reactor: ApplyPatronPenalty
        Validator: NOOP_TRUE
        Max Event Validity Delay: 1 day
        Template: test message

    with environment:

        Field Path: usr
        Label: user

        Field Path: usr.home_ou
        Label: context_org

    with event params:

        Parameter Name: standing_penalty
        Parameter Value: ALERT_NOTE

    Then bill a test patron for $100 and run something like:

    /openils/bin/action_trigger_runner.pl --osrf-config /openils/conf/opensrf_core.xml --run-pending

    Without the patch, you'll get something like this in osrfsys.log:

    ApplyPatronPenalty: missing parameters

    And no ALERT_NOTE penalty. With the patch you should see a "test message" alert note
    when reloading the patron.

tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.6.1
tags: added: cleanup
Changed in evergreen:
milestone: 3.6.1 → 3.6.2
Changed in evergreen:
milestone: 3.6.2 → 3.6.3
Changed in evergreen:
milestone: 3.6.3 → 3.6.4
Changed in evergreen:
milestone: 3.6.4 → 3.7.2
Changed in evergreen:
assignee: nobody → Chris Sharp (chrissharp123)
Revision history for this message
Chris Sharp (chrissharp123) wrote :

Works for me! Pushed to master, rel_3_7 and rel_3_6. Thanks, Jason.

Changed in evergreen:
status: New → Fix Committed
assignee: Chris Sharp (chrissharp123) → nobody
tags: added: signedoff
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.