The button generate discharge fetches all the discharges and puts a validation date to the most recent, regardless its state. This makes no sense in particular if there are more than one discharges.
Created attachment 179462 [details] [review] Bug 39369: Generating a discharge should not validate again a generated discharge Test plan: 1 - Apply Bug 37344 2 - Go on discharge.pl, click on "generate discharge" 3 - Drink a coffee (or do something during 1 min) 4 - Click again on the button - notice the date has changed 5 - Cancel the discharge 6 - Click again on the button - notice the cancelled discharge has been updated 7 - Apply patch 8 - Repeat 2 to 6 with following changes: 4 - Notice you simply print again the discharge 5 - Notice you create a new discharge 3 - If your tolerance to caffein is low, drink something else than coffee
Created attachment 179463 [details] [review] Bug 39369: Generating a discharge should not validate again a generated discharge Test plan: 1 - Apply Bug 37344 2 - Go on discharge.pl, click on "generate discharge" 3 - Drink a coffee (or do something during 1 min) 4 - Click again on the button - notice the date has changed 5 - Cancel the discharge 6 - Click again on the button - notice the cancelled discharge has been updated 7 - Apply patch 8 - Repeat 2 to 6 with following changes: 4 - Notice you simply print again the discharge 6 - Notice you create a new discharge 3 - If your tolerance to caffein is low, drink something else than coffee
Hi, 7th step did'nt go well Using index info to reconstruct a base tree... M Koha/Patron/Discharge.pm M installer/data/mysql/kohastructure.sql M koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt M koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt M members/discharge.pl M opac/opac-reserve.pl Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt Auto-merging installer/data/mysql/kohastructure.sql CONFLICT (content): Merge conflict in installer/data/mysql/kohastructure.sql CONFLICT (add/add): Merge conflict in installer/data/mysql/atomicupdate/bug_37344.pl Auto-merging installer/data/mysql/atomicupdate/bug_37344.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 37344: Add a real solution for discharge cancellation [33mhint: Use 'git am --show-current-patch=diff' to see the failed patch[m When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-37344-Add-a-real-solution-for-discharge-cancel-i1tqnky4.patch Cannot apply cleanly patches from bug 37344. Everything will be left dirty. git bz apply --continue will not continue the process if patches from other bug reports need to be applied. DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_37344.pl [13:43:43] [31mERROR: {UNKNOWN}: Can't use an undefined value as a subroutine reference at /kohadevbox/koha/C4/Installer.pm line 769. at /kohadevbox/koha/C4/Installer.pm line 771 [0m
I can apply the patches fine, on top of 37344. But after applying the patch, when I try to do a discharge, I get a 500 error, and I see this in the logs: ==> /var/log/koha/kohadev/plack-error.log <== DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'cancelled' in 'where clause' at /kohadevbox/koha/Koha/Patron/Discharge.pm line 73 The error does not happen without the patch.
Looks like I didn't run the database update, sorry for that! But it also looks like bug 37344 should be signed off before proceeding with this one.