[Bug 10374] New: Clean up and unify CircControl related code
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Bug ID: 10374 Summary: Clean up and unify CircControl related code Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: kyle.m.hall@gmail.com As discussed in bug 10262, code related to the CircControl should be unified under C4::Circulation::GetCircControlBranch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10262 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 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=10374 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18462 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18462&action=edit Bug 10374 - Clean up and unify CircControl related code As discussed in bug 10262, code related to the CircControl should be unified under C4::Circulation::GetCircControlBranch. Test Plan: 1) Apply this patch 2) Find some overdue items 2) Test the different settings for CircControl setting the system preference, returning an item, and verifying the correct rule was used. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18462|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18463 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18463&action=edit Bug 10374 - Clean up and unify CircControl related code As discussed in bug 10262, code related to the CircControl should be unified under C4::Circulation::GetCircControlBranch. Test Plan: 1) Apply this patch 2) Run perl t/db_dependent/Circulation.t 3) All tests should pass -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18467 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18467&action=edit Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn This patch tidys up C4::Circulation::AddReturn. It rearranges some comments to make them more sensible, and addresses the FIXME for an unitelligable comment. This patch makes no functional changes to the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18467|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18468 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18468&action=edit Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn This patch tidys up C4::Circulation::AddReturn. It rearranges some comments to make them more sensible, and addresses the FIXME for an unitelligable comment. This patch makes no functional changes to the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18468|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18469&action=edit Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn This patch tidys up C4::Circulation::AddReturn. It rearranges some comments to make them more sensible, and addresses the FIXME for an unitelligable comment. This patch makes no functional changes to the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18469|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18470&action=edit Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn This patch tidys up C4::Circulation::AddReturn. It rearranges some comments to make them more sensible, and addresses the FIXME for an unitelligable comment. This patch makes no functional changes to the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18470|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 18471 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18471&action=edit Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn This patch tidys up C4::Circulation::AddReturn. It rearranges some comments to make them more sensible, and addresses the FIXME for an unitelligable comment. This patch makes no functional changes to the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |gitbot@bugs.koha-community. | |org --- Comment #8 from I'm just a bot <gitbot@bugs.koha-community.org> --- Applying: Bug 10374 - Clean up and unify CircControl related code Using index info to reconstruct a base tree... M C4/Circulation.pm M C4/Reserves.pm M reserve/request.pl M t/db_dependent/Circulation.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Circulation.t CONFLICT (content): Merge conflict in t/db_dependent/Circulation.t Auto-merging reserve/request.pl Auto-merging C4/Reserves.pm CONFLICT (content): Merge conflict in C4/Reserves.pm Auto-merging C4/Circulation.pm Patch failed at 0001 Bug 10374 - Clean up and unify CircControl related code The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10374 --- Comment #9 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 18463 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18463 Bug 10374 - Clean up and unify CircControl related code Review of attachment 18463: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10374&attachment=18463) ----------------------------------------------------------------- This was the oldest bug that was "Patch does not apply", but since there are minor logic issues. I figure this commentary on them might spur a fix. ::: C4/Circulation.pm @@ +2249,5 @@
+ if ( $circcontrol eq 'PickupLibrary' ) { + if ( C4::Context->userenv && C4::Context->userenv->{branch} ) + { + $branch = C4::Context->userenv->{branch}; + } else {
If one is tweaking the if/else's, why not use a consistent style? Here it is "} else {" a few lines later "}" with "else {" on the next line. @@ +2265,5 @@
+ else { + $branch = $item->{ C4::Context->preference('HomeOrHoldingBranch') } + || $item->{homebranch}; + } + }
What happened to the else case? What if $circcontrol is not 'PickupLibrary', 'PatronLibrary', or 'ItemHomeLibrary'? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org