View | Details | Raw Unified | Return to bug 17964
Collapse All | Expand All

(-)a/C4/Letters.pm (-4 / +3 lines)
Lines 1575-1583 sub _get_tt_params { Link Here
1575
                        foreach my $key ( @$fk ) {
1575
                        foreach my $key ( @$fk ) {
1576
                            $search->{$key} = $id->{$key};
1576
                            $search->{$key} = $id->{$key};
1577
                        }
1577
                        }
1578
                        $object = $module->search( $search )->next();
1578
                        $object = $module->search( $search )->last();
1579
                    } else { # Foreign key is single column
1579
                    } else { # Foreign key is single column
1580
                        $object = $module->search( { $fk => $id } )->next();
1580
                        $object = $module->search( { $fk => $id } )->last();
1581
                    }
1581
                    }
1582
                } else { # using the table's primary key for lookup
1582
                } else { # using the table's primary key for lookup
1583
                    $object = $module->find($id);
1583
                    $object = $module->find($id);
Lines 1587-1593 sub _get_tt_params { Link Here
1587
            else {    # $ref eq 'ARRAY'
1587
            else {    # $ref eq 'ARRAY'
1588
                my $object;
1588
                my $object;
1589
                if ( @{ $tables->{$table} } == 1 ) {    # Param is a single key
1589
                if ( @{ $tables->{$table} } == 1 ) {    # Param is a single key
1590
                    $object = $module->search( { $pk => $tables->{$table} } )->next();
1590
                    $object = $module->search( { $pk => $tables->{$table} } )->last();
1591
                }
1591
                }
1592
                else {                                  # Params are mutliple foreign keys
1592
                else {                                  # Params are mutliple foreign keys
1593
                    croak "Multiple foreign keys (table $table) should be passed using an hashref";
1593
                    croak "Multiple foreign keys (table $table) should be passed using an hashref";
1594
- 

Return to bug 17964