Summary: | Deleting parent fund will orphan child funds, leaving them un-editable | ||
---|---|---|---|
Product: | Koha | Reporter: | Barton Chittenden <barton> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | cbrannon, chris, jonathan.druart, nengard, paola.rossi, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4292 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 12905: funds with children could not be deleted
Bug 12905: funds with children could not be deleted Bug 12905: funds with children could not be deleted Bug 12905: funds with children could not be deleted [PASSED QA] Bug 12905: funds with children could not be deleted |
Description
Barton Chittenden
2014-09-10 19:53:35 UTC
Created attachment 33413 [details] [review] Bug 12905: funds with children could not be deleted The interface should prevent to delete funds with children. Otherwise the relationship is broken and problems occur: 1/ You don't see the orphan fund in the fund list 2/ You cannot edit the orphan fund amount ('Fund amount exceeds parent allocation'). This patch: - adds a JS check, template side - adds a check in the perl script (should never be true) - adds an updatedatabase check, in order to alert users with inconsistent data. Test plan: Verify you are not allow to delete a fund with children. *** Bug 4292 has been marked as a duplicate of this bug. *** Created attachment 33457 [details] [review] Bug 12905: funds with children could not be deleted The interface should prevent to delete funds with children. Otherwise the relationship is broken and problems occur: 1/ You don't see the orphan fund in the fund list 2/ You cannot edit the orphan fund amount ('Fund amount exceeds parent allocation'). This patch: - adds a JS check, template side - adds a check in the perl script (should never be true) - adds an updatedatabase check, in order to alert users with inconsistent data. Test plan: Verify you are not allow to delete a fund with children. Signed-off-by: jeremie.benarros <jeremie.benarros@inlibro.com> Javascript verification is working, but i got an error when i'm 'hacking' the JS : Undefined subroutine &main::HasChildren called at /inlibro/git/koha-try4jeremie-dev-inlibro/admin/aqbudgets.pl line 234 Created attachment 33474 [details] [review] Bug 12905: funds with children could not be deleted The interface should prevent to delete funds with children. Otherwise the relationship is broken and problems occur: 1/ You don't see the orphan fund in the fund list 2/ You cannot edit the orphan fund amount ('Fund amount exceeds parent allocation'). This patch: - adds a JS check, template side - adds a check in the perl script (should never be true) - adds an updatedatabase check, in order to alert users with inconsistent data. Test plan: Verify you are not allow to delete a fund with children. (In reply to Jeremie from comment #3) > Javascript verification is working, but i got an error when i'm 'hacking' > the JS : > Undefined subroutine &main::HasChildren called at > /inlibro/git/koha-try4jeremie-dev-inlibro/admin/aqbudgets.pl line 234 Hello Jeremie, Thanks for testing it! Yes, the routine's name is BudgetHasChildren, not HasChildren... Fixed in the last patch, please retest. Jonathan and Barton, Can you verify that this problem still exists? Without the patch on master, I go through steps 1 through 11, and when I delete the parent, the child fund is deleted as well. There is no longer any sign of the child. Christopher (In reply to Christopher Brannon from comment #6) > Jonathan and Barton, > Can you verify that this problem still exists? > > Without the patch on master, I go through steps 1 through 11, and when I > delete the parent, the child fund is deleted as well. There is no longer > any sign of the child. > > Christopher Hi Christopher, I tested 2 weeks ago and the problems were there. They are: 1/ You don't see the orphan fund in the fund list 2/ You cannot edit the orphan fund amount ('Fund amount exceeds parent allocation'). for 1/ you need to use the MySQL CLI. Please back to "In discussion" if you confirm that you did not reproduce these 2 problems. Created attachment 34133 [details] [review] Bug 12905: funds with children could not be deleted On master (head 12123) the problem was still present at my tests. I deleted the parent fund/aqbudget and I still saw the child fund using the MySQL client. In intranet, the child fund was not listed anymore from "Funds" and it could be seen only by this link [X is the budget_id of the aqbudget]: </koha/admin/aqbudgets.pl?op=add_form&budget_id=X> I've applied the patch (head 12123). The patch needed a trivial rebase (on 3.19?). On a parent fund, the "Delete" action: was present in grey, warned "This fund has children." as mouse moved on it; and prevented me from deleting the fund by the message: "This fund has children. It cannot be deleted." when selected. On upgrading the database I saw the check alerting me about my inconsistent data, just as required. Everything seemed OK to me, I pass the patch to "Signed Off" status. Created attachment 34364 [details] [review] [PASSED QA] Bug 12905: funds with children could not be deleted The interface should prevent to delete funds with children. Otherwise the relationship is broken and problems occur: 1/ You don't see the orphan fund in the fund list 2/ You cannot edit the orphan fund amount ('Fund amount exceeds parent allocation'). This patch: - adds a JS check, template side - adds a check in the perl script (should never be true) - adds an updatedatabase check, in order to alert users with inconsistent data. Test plan: Verify you are not allow to delete a fund with children. Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Thanks Jonathan! Pushed to 3.18.x will be in 3.18.4 |