[Bug 15530] New: Editing a course item via a disabled course disables it even if it is on other enabled courses
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Bug ID: 15530 Summary: Editing a course item via a disabled course disables it even if it is on other enabled courses Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Course reserves Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org It appears that if the course item is edited by clicking the edit link from an active course, the course item will be set to enabled and the fields will be swapped, if the same course item is edited from a course that is *not* active, the course item will be set to *not* enabled, and the original fields will be swapped back in! The short term work-around is to only edit course items from an enabled course if the item has a course that is enabled. If all the courses it is on are disabled, it doesn't matter what course the item is edited from. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 46443 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46443&action=edit Bug 15530 - Add Unit Test -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 46444 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46444&action=edit Bug 15530 - Editing a course item via a disabled course disables it even if it is on other enabled courses It appears that if the course item is edited by clicking the edit link from an active course, the course item will be set to enabled and the fields will be swapped, if the same course item is edited from a course that is *not* active, the course item will be set to *not* enabled, and the original fields will be swapped back in! The short term work-around is to only edit course items from an enabled course if the item has a course that is enabled. If all the courses it is on are disabled, it doesn't matter what course the item is edited from. Test Plan: 1) Create two courses, 1 enabled and 1 disabled 2) Add an item as a course reserve to both courses 3) Edit the course reserve data for the item via the enabled course 4) Note the course item is enabled ( easy way is to check the database ) 5) Edit the same course reserve data, but via the disabled course 6) Note the course item is now disabled even though it is part of an enabled course! 7) Apply this patch 8) Repeat steps 1 through 5 9) Note the course item is still enabled -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46443|0 |1 is obsolete| | Attachment #46444|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 46445 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46445&action=edit Bug 15530 - Add Unit Test -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 46446 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46446&action=edit Bug 15530 - Editing a course item via a disabled course disables it even if it is on other enabled courses It appears that if the course item is edited by clicking the edit link from an active course, the course item will be set to enabled and the fields will be swapped, if the same course item is edited from a course that is *not* active, the course item will be set to *not* enabled, and the original fields will be swapped back in! The short term work-around is to only edit course items from an enabled course if the item has a course that is enabled. If all the courses it is on are disabled, it doesn't matter what course the item is edited from. Test Plan: 1) Create two courses, 1 enabled and 1 disabled 2) Add an item as a course reserve to both courses 3) Edit the course reserve data for the item via the enabled course 4) Note the course item is enabled ( easy way is to check the database ) 5) Edit the same course reserve data, but via the disabled course 6) Note the course item is now disabled even though it is part of an enabled course! 7) Apply this patch 8) Repeat steps 1 through 5 9) Note the course item is still enabled -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |sandboxes@biblibre.com --- Comment #5 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Patch tested with a sandbox, by Margaret Holt <mholt@bastyr.edu> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46445|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46446|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #6 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 46615 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46615&action=edit Bug 15530 - Add Unit Test Signed-off-by: Margaret Holt <mholt@bastyr.edu> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #7 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 46616 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46616&action=edit Bug 15530 - Editing a course item via a disabled course disables it even if it is on other enabled courses It appears that if the course item is edited by clicking the edit link from an active course, the course item will be set to enabled and the fields will be swapped, if the same course item is edited from a course that is *not* active, the course item will be set to *not* enabled, and the original fields will be swapped back in! The short term work-around is to only edit course items from an enabled course if the item has a course that is enabled. If all the courses it is on are disabled, it doesn't matter what course the item is edited from. Test Plan: 1) Create two courses, 1 enabled and 1 disabled 2) Add an item as a course reserve to both courses 3) Edit the course reserve data for the item via the enabled course 4) Note the course item is enabled ( easy way is to check the database ) 5) Edit the same course reserve data, but via the disabled course 6) Note the course item is now disabled even though it is part of an enabled course! 7) Apply this patch 8) Repeat steps 1 through 5 9) Note the course item is still enabled Signed-off-by: Margaret Holt <mholt@bastyr.edu> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Kyle, where is this enable/disable value used? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #8)
Kyle, where is this enable/disable value used?
"enabled" on a course item tells us if the fields have been swapped with the actual corresponding item fields. The incorrect assumption in the code was that the "enabled" value of the course an item was on would match the "enabled" value of the course itself. This is incorrect, as the value of "enabled" should be yes if *any* course the item is on is enabled. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- So if I understand correctly (not sure at all!), the course_items.enabled values could be retrieved from course_reserves.enabled? In this case, why don't we remove this column instead of trying to keep it up-to-date? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #10)
So if I understand correctly (not sure at all!), the course_items.enabled values could be retrieved from course_reserves.enabled? In this case, why don't we remove this column instead of trying to keep it up-to-date?
No, that is not quite right, here is the mapping: courses <=> courses_reserves <=> course_items course_reserves is a many to many join table between courses and course_items, so that a given item can be on course reserve for many courses at once. The short answer is, if all courses a course_item is part of are disabled, then the course_item should be disabled. If *any* of the courses are enabled, the course_item should be enabled. The 'enabled' flag again tells us whether the itype, ccode, holdingbranch and/or location field have been swapped with the originals. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46615|0 |1 is obsolete| | Attachment #46616|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47248 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47248&action=edit Bug 15530 - Add Unit Test Signed-off-by: Margaret Holt <mholt@bastyr.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15530 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47249 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47249&action=edit Bug 15530 - Editing a course item via a disabled course disables it even if it is on other enabled courses It appears that if the course item is edited by clicking the edit link from an active course, the course item will be set to enabled and the fields will be swapped, if the same course item is edited from a course that is *not* active, the course item will be set to *not* enabled, and the original fields will be swapped back in! The short term work-around is to only edit course items from an enabled course if the item has a course that is enabled. If all the courses it is on are disabled, it doesn't matter what course the item is edited from. Test Plan: 1) Create two courses, 1 enabled and 1 disabled 2) Add an item as a course reserve to both courses 3) Edit the course reserve data for the item via the enabled course 4) Note the course item is enabled ( easy way is to check the database ) 5) Edit the same course reserve data, but via the disabled course 6) Note the course item is now disabled even though it is part of an enabled course! 7) Apply this patch 8) Repeat steps 1 through 5 9) Note the course item is still enabled Signed-off-by: Margaret Holt <mholt@bastyr.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org