We pushed bug 20521 to enable the problematic SQL modes for dev installs, and now new tests (since bug 20144 has been pushed) are failing. Let's fix them again.
This will be an omnibus
Bug 21593 - Remove Group by clause in GetAuthValueDropbox 'koha_kohadev.me.id' isn't in GROUP BY
Bug 21598 - budget_parent_id isn't in GROUP BY - GetBudgetHierarchy
Bug 21599 - Incorrect decimal value: '' for column 'defaultreplacecost' - Cannot create item type
Bug 21596 - Should not set "" as default for some columns during patron import Patron import is failing, as well as the tests t/db_dependent/Koha/Patrons/Import.t
The previous bug reports are fixing bugs found by tests but impacting the interface. I am going to submit here the fixes for the tests.
Created attachment 80812 [details] [review] Bug 21597: Column 'notforloan' cannot be null Fix t/db_dependent/Circulation.t items.notforloan: `notforloan` tinyint(1) NOT NULL DEFAULT '0', t/db_dependent/Circulation.t .. 115/119 DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. # No tests run! # Failed test 'No tests run for subtest "item-level_itypes = 0"' # at t/db_dependent/Circulation.t line 2356. # Looks like you failed 1 test of 2. # Failed test 'CanBookBeIssued | notforloan' # at t/db_dependent/Circulation.t line 2359. Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.
Created attachment 80813 [details] [review] Bug 21597: Field 'amount' doesn't have a default value Fix t/db_dependent/Accounts.t Default value could be 0, or left as it. It seems that the different initialisation we have in the code pass a value for 'amount' account_offsets.amount `amount` decimal(26,6) NOT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Field 'amount' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125
Created attachment 80814 [details] [review] Bug 21597: Data too long for column 'invitekey' Fix t/db_dependent/Virtualshelves.t virtualshelfshares.invitekey `invitekey` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, We should not insert a longer string! DBIx::Class::Storage::DBI::_dbh_execute(): Data too long for column 'invitekey' at row 1 at /home/vagrant/kohaclone/Koha/Object.pm line 125
Created attachment 80815 [details] [review] Bug 21597: Incorrect date value: '0' for column 'onloan' Fix t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t items.onloan `onloan` date DEFAULT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect date value: '0' for column 'onloan' at row 1 at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 288
Created attachment 80816 [details] [review] Bug 21597: Field 'description' doesn't have a default value Nick proposed another fix, see bug 21594. The interface does not explode so I do not think we should make a DB update in a rush. Fix t/db_dependent/Koha/Object.t and t/db_dependent/Koha/ApiKeys.t api_keys.description and api_keys.secret: `secret` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, # Failed test 'Exception is thrown correctly' # at t/db_dependent/Koha/Object.t line 262. # expecting: Koha::Exceptions::Object::FKConstraint # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Field 'description' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 # ) # Looks like you planned 7 tests but ran 1. # Looks like you failed 1 test of 1 run. and later, but not related: Can't locate object method "message" via package "DBIx::Class::Exception" at t/db_dependent/Koha/Object.t line 264.
Created attachment 80821 [details] [review] Bug 21597: Incorrect decimal value: 't_value_bib639' for column 'price' Fix t/db_dependent/selenium/basic_workflow.t We want to send specific values depending on the data type in DB For instance integer, or varchar(10)
Ready for testing!
Created attachment 80829 [details] [review] Bug 21597: Column 'notforloan' cannot be null Fix t/db_dependent/Circulation.t items.notforloan: `notforloan` tinyint(1) NOT NULL DEFAULT '0', t/db_dependent/Circulation.t .. 115/119 DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. # No tests run! # Failed test 'No tests run for subtest "item-level_itypes = 0"' # at t/db_dependent/Circulation.t line 2356. # Looks like you failed 1 test of 2. # Failed test 'CanBookBeIssued | notforloan' # at t/db_dependent/Circulation.t line 2359. Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 80830 [details] [review] Bug 21597: Field 'amount' doesn't have a default value Fix t/db_dependent/Accounts.t Default value could be 0, or left as it. It seems that the different initialisation we have in the code pass a value for 'amount' account_offsets.amount `amount` decimal(26,6) NOT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Field 'amount' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 80831 [details] [review] Bug 21597: Data too long for column 'invitekey' Fix t/db_dependent/Virtualshelves.t virtualshelfshares.invitekey `invitekey` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, We should not insert a longer string! DBIx::Class::Storage::DBI::_dbh_execute(): Data too long for column 'invitekey' at row 1 at /home/vagrant/kohaclone/Koha/Object.pm line 125 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 80832 [details] [review] Bug 21597: Incorrect date value: '0' for column 'onloan' Fix t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t items.onloan `onloan` date DEFAULT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect date value: '0' for column 'onloan' at row 1 at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 288 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 80833 [details] [review] Bug 21597: Field 'description' doesn't have a default value Nick proposed another fix, see bug 21594. The interface does not explode so I do not think we should make a DB update in a rush. Fix t/db_dependent/Koha/Object.t and t/db_dependent/Koha/ApiKeys.t api_keys.description and api_keys.secret: `secret` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, # Failed test 'Exception is thrown correctly' # at t/db_dependent/Koha/Object.t line 262. # expecting: Koha::Exceptions::Object::FKConstraint # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Field 'description' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 # ) # Looks like you planned 7 tests but ran 1. # Looks like you failed 1 test of 1 run. and later, but not related: Can't locate object method "message" via package "DBIx::Class::Exception" at t/db_dependent/Koha/Object.t line 264. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 80834 [details] [review] Bug 21597: Incorrect decimal value: 't_value_bib639' for column 'price' Fix t/db_dependent/selenium/basic_workflow.t We want to send specific values depending on the data type in DB For instance integer, or varchar(10) Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Last failure seem to be api/v1/patrons.t but I did not manage to fix it. Opened a new bug report: Bug 21600 - t/db_dependent/api/v1/patrons.t is failing with new SQL modes
Created attachment 80852 [details] [review] Bug 21597: Column 'notforloan' cannot be null Fix t/db_dependent/Circulation.t items.notforloan: `notforloan` tinyint(1) NOT NULL DEFAULT '0', t/db_dependent/Circulation.t .. 115/119 DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. # No tests run! # Failed test 'No tests run for subtest "item-level_itypes = 0"' # at t/db_dependent/Circulation.t line 2356. # Looks like you failed 1 test of 2. # Failed test 'CanBookBeIssued | notforloan' # at t/db_dependent/Circulation.t line 2359. Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Column 'notforloan' cannot be null [for Statement "UPDATE `items` SET `notforloan` = ? WHERE ( `itemnumber` = ? )" with ParamValues: 0=undef, 1='1046'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 80853 [details] [review] Bug 21597: Field 'amount' doesn't have a default value Fix t/db_dependent/Accounts.t Default value could be 0, or left as it. It seems that the different initialisation we have in the code pass a value for 'amount' account_offsets.amount `amount` decimal(26,6) NOT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Field 'amount' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 80854 [details] [review] Bug 21597: Data too long for column 'invitekey' Fix t/db_dependent/Virtualshelves.t virtualshelfshares.invitekey `invitekey` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, We should not insert a longer string! DBIx::Class::Storage::DBI::_dbh_execute(): Data too long for column 'invitekey' at row 1 at /home/vagrant/kohaclone/Koha/Object.pm line 125 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 80855 [details] [review] Bug 21597: Incorrect date value: '0' for column 'onloan' Fix t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t items.onloan `onloan` date DEFAULT NULL, DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect date value: '0' for column 'onloan' at row 1 at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 288 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 80856 [details] [review] Bug 21597: Field 'description' doesn't have a default value Nick proposed another fix, see bug 21594. The interface does not explode so I do not think we should make a DB update in a rush. Fix t/db_dependent/Koha/Object.t and t/db_dependent/Koha/ApiKeys.t api_keys.description and api_keys.secret: `secret` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, # Failed test 'Exception is thrown correctly' # at t/db_dependent/Koha/Object.t line 262. # expecting: Koha::Exceptions::Object::FKConstraint # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Field 'description' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 # ) # Looks like you planned 7 tests but ran 1. # Looks like you failed 1 test of 1 run. and later, but not related: Can't locate object method "message" via package "DBIx::Class::Exception" at t/db_dependent/Koha/Object.t line 264. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 80857 [details] [review] Bug 21597: Incorrect decimal value: 't_value_bib639' for column 'price' Fix t/db_dependent/selenium/basic_workflow.t We want to send specific values depending on the data type in DB For instance integer, or varchar(10) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Straightforward fixes to tests. Passing QA
Patches here pushed to master, will need an new omnibus or to adjust and reopen
(In reply to Nick Clemens from comment #28) > Patches here pushed to master, will need an new omnibus or to adjust and > reopen With bug 21600 the tests should be ok. Others are not tests related (even if tests should have caught them!)
Pushed to 18.05.x for 18.05.06
I pass for new default SQL modes in 17.11.x
*** Bug 21594 has been marked as a duplicate of this bug. ***