Bugzilla – Attachment 31918 Details for
Bug 13005
suggestions.budgetid should be NULL if not filled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13005: suggestions.budgetid should be NULL if not filled
Bug-13005-suggestionsbudgetid-should-be-NULL-if-no.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2014-09-29 13:38:56 UTC
(
hide
)
Description:
Bug 13005: suggestions.budgetid should be NULL if not filled
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-29 13:38:56 UTC
Size:
2.19 KB
patch
obsolete
>From 3bb178100992935e71d8b32aade54d13ccd06823 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 29 Sep 2014 15:36:22 +0200 >Subject: [PATCH] Bug 13005: suggestions.budgetid should be NULL if not filled > >On creating/updating a suggestion, the budgetid should be NULL or >contain a budgetid, but not '0'. > >Test plan: >0/ Verify you have a suggestions.budgetid set to 0. >1/ Execute the updatedb entry and verify there is no budgetid==0 >anymore. >2/ Create and update a suggestion selecting a fund and verify the >budgetid DB field is correctly filled. >3/ Create and update a suggestion without selecting a fund and verify the >budgetid DB field is set to NULL. >--- > C4/Suggestions.pm | 3 +++ > installer/data/mysql/updatedatabase.pl | 9 +++++++++ > 2 files changed, 12 insertions(+) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index eae80a0..494da50 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -427,6 +427,7 @@ sub NewSuggestion { > my ($suggestion) = @_; > > $suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; >+ $suggestion->{budgetid} ||= undef; > > my $rs = Koha::Database->new->schema->resultset('Suggestion'); > return $rs->create($suggestion)->id; >@@ -449,6 +450,8 @@ sub ModSuggestion { > my ($suggestion) = @_; > return unless( $suggestion and defined($suggestion->{suggestionid}) ); > >+ $suggestion->{budgetid} ||= undef; >+ > my $rs = Koha::Database->new->schema->resultset('Suggestion')->find($suggestion->{suggestionid}); > my $status_update_table = 1; > eval { >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6ea5911..5d2c50e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8781,6 +8781,15 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = '3.17.00.XXX'; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ UPDATE suggestions SET budgetid=NULL WHERE budgetid=0 >+ }); >+ print "Upgrade to $DBversion done (Bug 13005: suggestions.budgetid should be NULL if not filled)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >2.1.0
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 13005
: 31918 |
31919