Bug 10374 - Clean up and unify CircControl related code
Summary: Clean up and unify CircControl related code
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-29 12:14 UTC by Kyle M Hall
Modified: 2023-06-08 22:26 UTC (History)
2 users (show)

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


Attachments
Bug 10374 - Clean up and unify CircControl related code (16.58 KB, patch)
2013-05-29 12:16 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code (16.99 KB, patch)
2013-05-29 12:32 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn (15.48 KB, patch)
2013-05-29 13:13 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn (15.50 KB, patch)
2013-05-29 13:14 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn (15.49 KB, patch)
2013-05-29 13:16 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn (15.49 KB, patch)
2013-05-29 13:18 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10374 - Clean up and unify CircControl related code - Followup - Clean up AddReturn (15.46 KB, patch)
2013-05-29 13:23 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-05-29 12:14:05 UTC
As discussed in bug 10262, code related to the CircControl should be unified under C4::Circulation::GetCircControlBranch.
Comment 1 Kyle M Hall (khall) 2013-05-29 12:16:48 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2013-05-29 12:32:53 UTC
Created attachment 18463 [details] [review]
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
Comment 3 Kyle M Hall (khall) 2013-05-29 13:13:19 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall (khall) 2013-05-29 13:14:40 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2013-05-29 13:16:00 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall (khall) 2013-05-29 13:18:55 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall (khall) 2013-05-29 13:23:58 UTC
Created attachment 18471 [details] [review]
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.
Comment 8 I'm just a bot 2013-09-18 11:19:40 UTC
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".
Comment 9 Mark Tompsett 2015-04-04 13:52:29 UTC
Comment on attachment 18463 [details] [review]
Bug 10374 - Clean up and unify CircControl related code

Review of attachment 18463 [details] [review]:
-----------------------------------------------------------------

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'?