Default values are causing issues: DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect integer value: '' for column 'budget_period_id' at row 1 at /home/vagrant/kohaclone/C4/Budgets.pm line 138 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Created attachment 80885 [details] [review] Bug 21604: Fix add/edit fund/budget [Strict SQL modes context] For insert aqbudgetperiods: Incorrect integer value: '' for column 'budget_period_id' For insert/update aqbudgets Incorrect integer value: '' for column 'budget_owner_id' Incorrect decimal value: '' for column 'budget_encumb' Test plan: Add/edit budgets and funds A good example of why we should use Koha::Object for all our objects
Created attachment 80959 [details] [review] Bug 21604: Fix add/edit fund/budget [Strict SQL modes context] For insert aqbudgetperiods: Incorrect integer value: '' for column 'budget_period_id' For insert/update aqbudgets Incorrect integer value: '' for column 'budget_owner_id' Incorrect decimal value: '' for column 'budget_encumb' Test plan: Add/edit budgets and funds A good example of why we should use Koha::Object for all our objects Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
I added <strict_sql_modes>1</strict_sql_modes> to /etc/koha/sites/kohadev/koha-conf.xml and restart_all and restarted memcached separately too, but I fail to make things explode. What am I missing?
Created attachment 81858 [details] [review] Bug 21604: Add two trivial test cases Adding an id in AddBudgetPeriod and an empty string in AddBudget for budget_encumb. Test plan: Run Budgets.t with/without this patch in strict sql mode. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 81859 [details] [review] Bug 21604: Fix add/edit fund/budget [Strict SQL modes context] For insert aqbudgetperiods: Incorrect integer value: '' for column 'budget_period_id' For insert/update aqbudgets Incorrect integer value: '' for column 'budget_owner_id' Incorrect decimal value: '' for column 'budget_encumb' Test plan: Add/edit budgets and funds A good example of why we should use Koha::Object for all our objects Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Katrin Fischer from comment #3) > I added <strict_sql_modes>1</strict_sql_modes> to > /etc/koha/sites/kohadev/koha-conf.xml and restart_all and restarted > memcached separately too, but I fail to make things explode. What am I > missing? Sabotaged the test to show it :)
(In reply to Marcel de Rooy from comment #6) > (In reply to Katrin Fischer from comment #3) > > I added <strict_sql_modes>1</strict_sql_modes> to > > /etc/koha/sites/kohadev/koha-conf.xml and restart_all and restarted > > memcached separately too, but I fail to make things explode. What am I > > missing? > > Sabotaged the test to show it :) Turns out the entry needs to go within the config section (figured it out later, updated wiki)
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.06
SQL modes not in 17.11.x