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

(-)a/C4/Suggestions.pm (+2 lines)
Lines 437-442 sub NewSuggestion { Link Here
437
        accepteddate
437
        accepteddate
438
        rejectedby
438
        rejectedby
439
        rejecteddate
439
        rejecteddate
440
        budgetid
440
    ) ) {
441
    ) ) {
441
        # Set the fields to NULL if not given.
442
        # Set the fields to NULL if not given.
442
        $suggestion->{$field} ||= undef;
443
        $suggestion->{$field} ||= undef;
Lines 475-480 sub ModSuggestion { Link Here
475
        accepteddate
476
        accepteddate
476
        rejectedby
477
        rejectedby
477
        rejecteddate
478
        rejecteddate
479
        budgetid
478
    ) ) {
480
    ) ) {
479
        # Set the fields to NULL if not given.
481
        # Set the fields to NULL if not given.
480
        $suggestion->{$field} = undef
482
        $suggestion->{$field} = undef
(-)a/t/db_dependent/Suggestions.t (-4 / +10 lines)
Lines 24-30 use C4::Budgets; Link Here
24
24
25
use Koha::DateUtils qw( dt_from_string );
25
use Koha::DateUtils qw( dt_from_string );
26
26
27
use Test::More tests => 102;
27
use Test::More tests => 104;
28
use Test::Warn;
28
use Test::Warn;
29
29
30
BEGIN {
30
BEGIN {
Lines 318-323 is(@$itemtypes2, 8, "Purchase suggestion itemtypes collected, default AdvancedSe Link Here
318
318
319
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
319
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
320
320
321
$dbh->rollback;
321
# Test budgetid fk
322
$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB
323
my $my_suggestionid_test_budgetid = NewSuggestion($my_suggestion);
324
$suggestion = GetSuggestion($my_suggestionid_test_budgetid);
325
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' );
322
326
323
done_testing;
327
$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB
328
ModSuggestion( $my_suggestion );
329
$suggestion = GetSuggestion($my_suggestionid_test_budgetid);
330
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' );
324
- 

Return to bug 13007