If sample holidays are chosen in the onboarding tool, there is an error message: sample_libraries_holidays.yml DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_pks`.`repeatable_holidays`, CONSTRAINT `repeatable_holidays_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE) at /usr/share/koha/lib/C4/Installer.pm line 575. This is probably due to the fact that at that stage no branches have yet been created for the instance. It would probably with sample branches chosen but it should work also without the sample branches.
It cannot work without the sample branches as every holiday needs to be connected to a library. They cannot be added without a library present in the database. The sample data is loaded before the onboarding process starts. I think the best we could probably do is maybe to lock/grey out the checkbox when the sample libraries are not selected.
Thanks for the explanation. The problem with sample branches is that there are quite a lot of them that are really cumbersome to remove later on. I would suggest either one of the following: - Reduce the number of sample branches to maybe one to three at most and explain in the web installer that they have to be checked for the sample holidays to function - change the order of the process so that people can add their own branch(es) before importing the sample holidays - just explain in the web installer that without the sample branches the sample holidays can't be imported, and give a hint how many sample branches there are so one knows what to expect.
Created attachment 152083 [details] [review] Bug 33581: Disable sample holiday if libraries are not selected If libraries are not selected we should not try to insert holidays, or the installer will fail with a missing FK. This patch simply disable and uncheck the checkbox when libraries are not going to be inserted.
Created attachment 152142 [details] [review] Bug 33581: Disable sample holiday if libraries are not selected If libraries are not selected we should not try to insert holidays, or the installer will fail with a missing FK. This patch simply disable and uncheck the checkbox when libraries are not going to be inserted. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 152143 [details] [review] Bug 33581: Add sample patrons to patch and some hints * Adds sample patrons to the new dependency checking JS * Adds a red "requires sample libraries" note to sample patrons and sample holidays, to make things more clear to users. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Looks like this: https://snipboard.io/MRlWT6.jpg
Created attachment 152188 [details] [review] Bug 33581: Disable sample holiday if libraries are not selected If libraries are not selected we should not try to insert holidays, or the installer will fail with a missing FK. This patch simply disable and uncheck the checkbox when libraries are not going to be inserted. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 152189 [details] [review] Bug 33581: Add sample patrons to patch and some hints * Adds sample patrons to the new dependency checking JS * Adds a hind "requires sample libraries" to sample patrons and sample holidays. To test: * Build CSS (yarn build) * Veriy the checkbox for sample patrons works like the sample holidays one * Verify the hint shows up as intended Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 153307 [details] [review] Bug 33581: Disable sample holiday if libraries are not selected If libraries are not selected we should not try to insert holidays, or the installer will fail with a missing FK. This patch simply disable and uncheck the checkbox when libraries are not going to be inserted. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 153308 [details] [review] Bug 33581: Add sample patrons to patch and some hints * Adds sample patrons to the new dependency checking JS * Adds a hind "requires sample libraries" to sample patrons and sample holidays. To test: * Build CSS (yarn build) * Veriy the checkbox for sample patrons works like the sample holidays one * Verify the hint shows up as intended Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x
I marked this report as the suspect for no longer creating sample patrons. Bug 34337