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

(-)a/C4/Suggestions.pm (+2 lines)
Lines 436-441 sub NewSuggestion { Link Here
436
        accepteddate
436
        accepteddate
437
        rejectedby
437
        rejectedby
438
        rejecteddate
438
        rejecteddate
439
        budgetid
439
    ) ) {
440
    ) ) {
440
        # Set the fields to NULL if not given.
441
        # Set the fields to NULL if not given.
441
        $suggestion->{$field} ||= undef;
442
        $suggestion->{$field} ||= undef;
Lines 474-479 sub ModSuggestion { Link Here
474
        accepteddate
475
        accepteddate
475
        rejectedby
476
        rejectedby
476
        rejecteddate
477
        rejecteddate
478
        budgetid
477
    ) ) {
479
    ) ) {
478
        # Set the fields to NULL if not given.
480
        # Set the fields to NULL if not given.
479
        $suggestion->{$field} = undef
481
        $suggestion->{$field} = undef
(-)a/t/db_dependent/Suggestions.t (-3 / +11 lines)
Lines 23-29 use C4::Letters; Link Here
23
23
24
use Koha::DateUtils qw( dt_from_string );
24
use Koha::DateUtils qw( dt_from_string );
25
25
26
use Test::More tests => 98;
26
use Test::More tests => 100;
27
use Test::Warn;
27
use Test::Warn;
28
28
29
BEGIN {
29
BEGIN {
Lines 274-277 is(@$itemtypes2, 8, "Purchase suggestion itemtypes collected, default AdvancedSe Link Here
274
274
275
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
275
is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved');
276
276
277
$dbh->rollback;
277
# Test budgetid fk
278
$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB
279
my $my_suggestionid_test_budgetid = NewSuggestion($my_suggestion);
280
$suggestion = GetSuggestion($my_suggestionid_test_budgetid);
281
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' );
282
283
$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB
284
ModSuggestion( $my_suggestion );
285
$suggestion = GetSuggestion($my_suggestionid_test_budgetid);
286
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' );
278
- 

Return to bug 13007