Bugzilla – Attachment 33808 Details for
Bug 13007
suggestions.budgetid should be a foreign key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13007: Special case budgetid == ''
PASSED-QA-Bug-13007-Special-case-budgetid--.patch (text/plain), 2.34 KB, created by
Katrin Fischer
on 2014-11-22 10:37:49 UTC
(
hide
)
Description:
[PASSED QA] Bug 13007: Special case budgetid == ''
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-11-22 10:37:49 UTC
Size:
2.34 KB
patch
obsolete
>From 3c66d332fb2399e13274932082b8df20e33a1c57 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 18 Nov 2014 10:20:56 +0100 >Subject: [PATCH] [PASSED QA] Bug 13007: Special case budgetid == '' > >In this special case (the suggestion is linked to "all funds"), the >budgetid value should be NULL in DB. > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Works as described, passes old and new tests. >--- > C4/Suggestions.pm | 2 ++ > t/db_dependent/Suggestions.t | 13 +++++++++++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 1d9edbb..ee421d9 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -436,6 +436,7 @@ sub NewSuggestion { > accepteddate > rejectedby > rejecteddate >+ budgetid > ) ) { > # Set the fields to NULL if not given. > $suggestion->{$field} ||= undef; >@@ -474,6 +475,7 @@ sub ModSuggestion { > accepteddate > rejectedby > rejecteddate >+ budgetid > ) ) { > # Set the fields to NULL if not given. > $suggestion->{$field} = undef >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 47e5ad4..dc9d131 100644 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -23,7 +23,7 @@ use C4::Letters; > > use Koha::DateUtils qw( dt_from_string ); > >-use Test::More tests => 98; >+use Test::More tests => 100; > use Test::Warn; > > BEGIN { >@@ -274,4 +274,13 @@ is(@$itemtypes2, 8, "Purchase suggestion itemtypes collected, default AdvancedSe > > is_deeply($itemtypes1, $itemtypes2, 'same set of purchase suggestion formats retrieved'); > >-$dbh->rollback; >+# Test budgetid fk >+$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB >+my $my_suggestionid_test_budgetid = NewSuggestion($my_suggestion); >+$suggestion = GetSuggestion($my_suggestionid_test_budgetid); >+is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' ); >+ >+$my_suggestion->{budgetid} = ''; # If budgetid == '', NULL should be set in DB >+ModSuggestion( $my_suggestion ); >+$suggestion = GetSuggestion($my_suggestionid_test_budgetid); >+is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' ); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13007
:
31924
|
31945
|
33241
|
33242
|
33643
|
33644
|
33651
|
33653
|
33807
|
33808
|
35601
|
35602