Sometimes using "Mark selection as" to update a suggestions can result in a 500 error with the logged error: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggestion_itemtype' in 'where clause' at /usr/share/koha/lib/Koha/Objects.pm line 394 It appears that the search params are built from *all* the form fields and then some form fields are removed from the hashref, but not all ( hence the error ).
Created attachment 152524 [details] [review] Bug 34080 - Updating suggestion status can result in 500 error Sometimes using "Mark selection as" to update a suggestions can result in a 500 error with the logged error: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggestion_itemtype' in 'where clause' at /usr/share/koha/lib/Koha/Objects.pm line 394 It appears that the search params are built from *all* the form fields and then some form fields are removed from the hashref, but not all ( hence the error ).
This patch stops the 500 error from occurring. However, with it applied I am unable to switch the status of suggestions.
To recreate: 1. Make some suggestions with different statuses. 2. Try moving some suggestion to different statuses. 3. Going from PENDING to another status works fine. 4. Moving from other status (REJECTED, ORDERED, etc ) will cause a 500 error.
The suggestions_batch_ops div is repeated and therefore should be a class not and an ID.
Created attachment 152643 [details] [review] Bug 34080: Make suggestions_batch_ops a class To test: 1. Make some suggestions with different statuses. 2. Try moving some suggestion to different statuses. 3. Going from PENDING to another status works fine. 4. Moving from other status (REJECTED, ORDERED, etc ) will cause a 500 error. 5. Apply patch 6. Try 2 - 4 again, no more 500 errors, yay!
Marked as major because this effects libraries ability to manage purchase suggestions.
Created attachment 152644 [details] [review] Bug 34080: Make suggestions_batch_ops a class To test: 1. Make some suggestions with different statuses. 2. Try moving some suggestion to different statuses. 3. Going from PENDING to another status works fine. 4. Moving from other status (REJECTED, ORDERED, etc ) will cause a 500 error. 5. Apply patch 6. Try 2 - 4 again, no more 500 errors, yay! Signed-off-by: Sam Lau <samalau@gmail.com>
Created attachment 152645 [details] [review] Bug 34080: Make suggestions_batch_ops a class To test: 1. Make some suggestions with different statuses. 2. Try moving some suggestion to different statuses. 3. Going from PENDING to another status works fine. 4. Moving from other status (REJECTED, ORDERED, etc ) will cause a 500 error. 5. Apply patch 6. Try 2 - 4 again, no more 500 errors, yay! Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial fix works as expected.. Passing QA
Pushed to master for 23.11. Nice work everyone, thanks!
Is this bug going to be backported to 22.11?
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to 22.11.x for next release