Bug 5212

Summary: Overdue_notices.pl grabbing wrong item information for parsing
Product: Koha Reporter: Ian Walls <koha.sekjal>
Component: NoticesAssignee: Ian Walls <koha.sekjal>
Status: CLOSED DUPLICATE QA Contact: Bugs List <koha-bugs>
Severity: major    
Priority: PATCH-Sent (DO NOT USE) CC: nengard
Version: rel_3_2   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: patch

Description Ian Walls 2010-09-09 14:46:51 UTC
Overdue notices that make use of the <item>.... </item> feature to grab specific fields from biblio, biblioitems and items are getting the wrong item information pulled into them.  This stems from the use of the biblionumber as the key to the items table.  See the following code snippet from overdue_notices.pl:

sub parse_letter { # FIXME: this code should probably be moved to C4::Letters:parseletter
    my $params = shift;

---Snip----

    if ( $params->{'biblionumber'} ) {
        my $item_format = '';
        PROCESS_ITEMS:
        while (scalar(@{$params->{'biblionumber'}}) > 0) {
            my $item = shift @{$params->{'biblionumber'}};

---Snip----

            $params->{'letter'} = C4::Letters::parseletter( $params->{'letter'}, 'biblio',      $item );
            $params->{'letter'} = C4::Letters::parseletter( $params->{'letter'}, 'biblioitems', $item );
            $params->{'letter'} = C4::Letters::parseletter( $params->{'letter'}, 'items', $item );

The same key value is used for all three fields.  This could theoretically also be a problem for biblioitems, but this is highly unlikely in Koha 3.X unless local database changes were made.

The params past to parseletter are in an array called @items, but they are biblionumbers, possibly leading to some of this confusion.
Comment 1 Nicole C. Engard 2010-09-09 17:58:22 UTC
I have signed off on Ian's patch
Comment 2 Nicole C. Engard 2010-09-09 17:59:06 UTC
Created attachment 2612 [details] [review]
patch
Comment 3 Ian Walls 2010-11-23 17:08:40 UTC
The patch submitted here is essentially re-implemented with the fix for bug 5381.  Marking this bug as a duplicate.

*** This bug has been marked as a duplicate of bug 5381 ***