Bug 8534 - Remove unused variable from memberentry template
Summary: Remove unused variable from memberentry template
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-31 12:30 UTC by Kyle M Hall
Modified: 2017-06-14 22:10 UTC (History)
7 users (show)

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


Attachments
Bug 8534 - Remove unused variable from memberentry template (1.44 KB, patch)
2012-07-31 12:32 UTC, Kyle M Hall
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 2012-07-31 12:30:33 UTC
The variable nobranchcode is used in an UNLESS statement in memberentry.tt. It exists nowhere else in the codebase, and is thus superfluous.

Somehow, despite the fact that is never referenced anywhere else in the code base, it is getting set to '1' for one of our libraries. This means they cannot add patrons, due to the submitted data lacking a patron branchcode.
Comment 1 Kyle M Hall 2012-07-31 12:32:09 UTC
Created attachment 11218 [details] [review]
Bug 8534 - Remove unused variable from memberentry template

The variable nobranchcode is used in an UNLESS statement in
memberentry.tt. It exists nowhere else in the codebase,
and is thus superfluous.

This patch removes this unnecessary code.
Comment 2 Jared Camins-Esakov 2012-07-31 12:43:27 UTC
(In reply to comment #0)
> Somehow, despite the fact that is never referenced anywhere else in the code
> base, it is getting set to '1' for one of our libraries. This means they
> cannot add patrons, due to the submitted data lacking a patron branchcode.

It seems to me that removing the conditional is the wrong solution. The nobranchcode variable demonstratively *is* being set, if you're running into problems, so the actual cause of the problem should be located, and the underlying logic issue fixed.
Comment 3 Jared Camins-Esakov 2012-07-31 12:48:56 UTC
Take a look around lines 108-112 of memberentry.pl. You will want to change the syspref BorrowerUnwantedField to not include "branchcode" for that library.
Comment 4 Kyle M Hall 2012-07-31 16:03:16 UTC
Thanks for the additional information. I missed that and grepping of course did not reveal that code.

Koha has foreign key constraints that causes adding a borrower without a branchcode to fail. Is there a valid use-case for keeping this bit of code in Koha?
Comment 5 Julian Maurice 2012-08-09 13:14:01 UTC
I reset the status to ASSIGNED, as the actual patch cannot be signed-off.
Comment 6 Kyle M Hall 2012-08-11 12:43:00 UTC
(In reply to comment #5)
> I reset the status to ASSIGNED, as the actual patch cannot be signed-off.

I'm not sure shat you mean by this. Why do you think the actual patch cannot be signed-off?
Comment 7 Katrin Fischer 2012-08-11 12:48:07 UTC
I think if you have only one branch you could autofill the branch value and that might be a reason to hide it. I think signing off the patch would make the feature inconsistent.
Comment 8 Marc Véron 2016-05-23 15:11:34 UTC
Can this Bug be marked as RESOLVED INVALID?
Comment 9 Jonathan Druart 2016-09-30 09:50:47 UTC
It comes from BorrowerUnwantedField.
This is a configuration issue.