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.
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.
(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.
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.
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?
I reset the status to ASSIGNED, as the actual patch cannot be signed-off.
(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?
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.
Can this Bug be marked as RESOLVED INVALID?
It comes from BorrowerUnwantedField. This is a configuration issue.