Bug 9835

Summary: Brackets missing for branches for patron attribute types
Product: Koha Reporter: Brendan Gallagher <brendan>
Component: System AdministrationAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P5 - low CC: christophe.croullebois, colin.campbell, gmcharlt, jonathan.druart, paul.poulain
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: proposed patch
bug 9835: Lack of brackets in patron-attr-types.pl line 300

Description Brendan Gallagher 2013-03-18 13:47:59 UTC
Software error:

Can't call method "branches" on an undefined value at kohaclone/admin/patron-attr-types.pl line 300.
For help, please send mail to the webmaster (webmaster@mybox), giving this error message and the time and date of the error.
Comment 1 Christophe Croullebois 2013-03-18 14:08:44 UTC Comment hidden (obsolete)
Comment 2 Colin Campbell 2013-03-18 16:28:06 UTC
Its a typo all right but fetch can also return undef shouldn't we also check for that??
Comment 3 Owen Leonard 2013-03-20 01:03:36 UTC
Does this cause a problem which can be reproduced? Can the outcome be tested?
Comment 4 Paul Poulain 2013-03-21 09:20:34 UTC
Patch tested with a sandbox, by Cedric Vita <cedric.vita@dracenie.com>
Comment 5 Paul Poulain 2013-03-21 09:20:51 UTC
Created attachment 16585 [details] [review]
bug 9835: Lack of brackets in patron-attr-types.pl line 300

produces a warning 'Can't call method "branches" on an undefined value'...

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Comment 6 Katrin Fischer 2013-03-21 15:49:32 UTC
I have seen the error on Brendan's installation, but can't reproduce right now - maybe someone else can?
Comment 7 Jonathan Druart 2013-03-21 16:12:23 UTC
I cannot reproduced.
And I don't understand the patch. C4::Members::AttributeTypes has a branches method and it is the method we want to call.
I would prefer:
  $attr->{branches} = $attr_type->branches if defined $attr_type;

But at this place, $attr_type should be defined.

Could you produce a test plan to reproduce the issue please?
Comment 8 Brendan Gallagher 2013-03-21 16:19:42 UTC
I can only repeat this on my install and we have not been able to repeat this anywhere else - we have tried four other installs and I have tried other installs on other boxes.

I think we can just disregard this bug until another person reports this problem.

-Brendan