Bug 5212 - Overdue_notices.pl grabbing wrong item information for parsing
Summary: Overdue_notices.pl grabbing wrong item information for parsing
Status: CLOSED DUPLICATE of bug 5381
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: rel_3_2
Hardware: All All
: PATCH-Sent (DO NOT USE) major (vote)
Assignee: Ian Walls
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 14:46 UTC by Ian Walls
Modified: 2012-10-26 00:41 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
patch (4.58 KB, patch)
2010-09-09 17:59 UTC, Nicole C. Engard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 ***