Bug 9272 - Plack goes into paroxysms of horror when faced with deleting an authorized value
Summary: Plack goes into paroxysms of horror when faced with deleting an authorized value
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 3309
  Show dependency treegraph
 
Reported: 2012-12-12 13:36 UTC by Jared Camins-Esakov
Modified: 2014-05-26 21:04 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9272: Eliminate error when deleting authorized value (1.71 KB, patch)
2012-12-12 13:43 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9272: Eliminate error when deleting authorized value (1.02 KB, patch)
2012-12-12 15:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9272: Eliminate error when deleting authorized value (1.16 KB, patch)
2012-12-13 21:40 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 9272: Eliminate error when deleting authorized value (1.26 KB, patch)
2012-12-28 15:38 UTC, Elliott Davis
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2012-12-12 13:36:44 UTC
When DEBUG is turned on under Plack, any attempt to delete an authorized value from the staff client interface results in a DBD error:
DBD::mysql::st execute failed: Unknown column 'id' in 'where clause' at /home/jcamins/kohaclone/admin/authorised_values.pl line 228.
 at /home/jcamins/kohaclone/admin/authorised_values.pl line 300
Comment 1 Jared Camins-Esakov 2012-12-12 13:43:28 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-12-12 15:19:00 UTC
Even without Plack the issue exists. Your patch works great but I am under the impression that the query is useless: There is the "on delete cascade" option on the constraint (authorised_values_branches_ibfk_1). So normally the deletion should be automatic and then this query never deletes something.

I can provide a patch if you confirm that the query is useless.
Comment 3 Jared Camins-Esakov 2012-12-12 15:39:27 UTC
(In reply to comment #2)
> Even without Plack the issue exists. Your patch works great but I am under
> the impression that the query is useless: There is the "on delete cascade"
> option on the constraint (authorised_values_branches_ibfk_1). So normally
> the deletion should be automatic and then this query never deletes something.
> 
> I can provide a patch if you confirm that the query is useless.

I can confirm that when I tested my patch there were never any rows for that query to delete. Now that you point out the constraint, I realize that this was not a coincidence. A counter-patch would be welcomed.
Comment 4 Jonathan Druart 2012-12-12 15:49:20 UTC Comment hidden (obsolete)
Comment 5 Mirko Tietgen 2012-12-13 21:40:03 UTC Comment hidden (obsolete)
Comment 6 Elliott Davis 2012-12-28 15:38:06 UTC
Created attachment 14313 [details] [review]
Bug 9272: Eliminate error when deleting authorized value

Try to delete an authorized value. if you don't get any error, this
patch works.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Enabled debug, tried with and without Plack, works fine for both.

Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Works as advertised. Follows coding guidelines.
Comment 7 Jared Camins-Esakov 2012-12-29 01:14:02 UTC
This patch has been pushed to master.
Comment 8 Chris Cormack 2013-04-24 07:36:57 UTC
Was pushed to 3.10.x a while back, missed updating the status