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

(-)a/C4/Letters.pm (-4 / +3 lines)
Lines 1589-1597 sub _get_tt_params { Link Here
1589
                        foreach my $key ( @$fk ) {
1589
                        foreach my $key ( @$fk ) {
1590
                            $search->{$key} = $id->{$key};
1590
                            $search->{$key} = $id->{$key};
1591
                        }
1591
                        }
1592
                        $object = $module->search( $search )->next();
1592
                        $object = $module->search( $search )->last();
1593
                    } else { # Foreign key is single column
1593
                    } else { # Foreign key is single column
1594
                        $object = $module->search( { $fk => $id } )->next();
1594
                        $object = $module->search( { $fk => $id } )->last();
1595
                    }
1595
                    }
1596
                } else { # using the table's primary key for lookup
1596
                } else { # using the table's primary key for lookup
1597
                    $object = $module->find($id);
1597
                    $object = $module->find($id);
Lines 1601-1607 sub _get_tt_params { Link Here
1601
            else {    # $ref eq 'ARRAY'
1601
            else {    # $ref eq 'ARRAY'
1602
                my $object;
1602
                my $object;
1603
                if ( @{ $tables->{$table} } == 1 ) {    # Param is a single key
1603
                if ( @{ $tables->{$table} } == 1 ) {    # Param is a single key
1604
                    $object = $module->search( { $pk => $tables->{$table} } )->next();
1604
                    $object = $module->search( { $pk => $tables->{$table} } )->last();
1605
                }
1605
                }
1606
                else {                                  # Params are mutliple foreign keys
1606
                else {                                  # Params are mutliple foreign keys
1607
                    croak "Multiple foreign keys (table $table) should be passed using an hashref";
1607
                    croak "Multiple foreign keys (table $table) should be passed using an hashref";
1608
- 

Return to bug 17964