Letters.t $dbh->do(q|UPDATE subscription_numberpatterns SET numberingmethod='No. {X}' WHERE id=1|); t/db_dependent/Letters.t .. 51/85 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_myclone`.`subscription`, CONSTRAINT `subscription_ibfk_2` FOREIGN KEY (`numberpattern`) REFERENCES `subscription_numberpatterns` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) at /usr/share/koha/Koha/Object.pm line 170 Hmm. You should have a record with id=1 in your table. This is bad.
Created attachment 150963 [details] [review] Bug 33403: Fix Letters.t if number pattern with id=1 does not exist Bad assumption in DB, we should create the data we need Test plan: > delete from subscription_numberpatterns; prove t/db_dependent/Letters.t
Created attachment 150965 [details] [review] Bug 33403: Fix Letters.t if number pattern with id=1 does not exist Bad assumption in DB, we should create the data we need Test plan: > delete from subscription_numberpatterns; prove t/db_dependent/Letters.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
SO + QA
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x