Bug 15535 - can't call method "default-privacy" on an undefined value /usr/share/koha/lib/c4/members.pm line 753
Summary: can't call method "default-privacy" on an undefined value /usr/share/koha/lib...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-10 11:16 UTC by M. Irfan Aslam
Modified: 2023-08-28 20:40 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M. Irfan Aslam 2016-01-10 11:16:04 UTC
When I try to create a patron from opac. A message appears (can't call method "default-privacy" on an undefind value /usr/share/koha/lib/c4/members.pm line 753) on submitting the form after filling it.
Comment 1 Jonathan Druart 2016-01-11 10:45:54 UTC
Could you please confirm that your system preference PatronSelfRegistrationDefaultCategory is filled with a valid patron category?
Comment 2 Marc Véron 2016-01-11 16:06:38 UTC
Testing:

If PatronSelfRegistrationDefaultCategory is empty, the link for self registration is not displayed in OPAC

If PatronSelfRegistrationDefaultCategory is set to a category that does not exist, the error can be triggered.

It happens as well if there is a leading space char by mistake. Example with a valid category PT:

[PT] -> OK
[PT    ] -> OK (one or more trailing space chars)
[ PT] -> Software error (Leading space char)
[   ] -> Software eror (one or more space chars)

Maybe we could

- validate the syspref field for not having leading spaces or spaces only

- give some more explanation in the syspref descriptions for PatronSelfRegistration depending on a correct value for PatronSelfRegistrationDefaultCategory

- add a warning on the about page (tab system information) if PatronSelfRegistration is set and PatronSelfRegistrationDefaultCategory is wrong or does not exist

- not display the self registration link if PatronSelfRegistration is set and PatronSelfRegistrationDefaultCategory is wrong or does not exist
Comment 3 Aleisha Amohia 2016-01-14 03:03:25 UTC
(In reply to Marc Véron from comment #2)

> - not display the self registration link if PatronSelfRegistration is set
> and PatronSelfRegistrationDefaultCategory is wrong or does not exist

I think this is probably the best option, as well as updating the descriptions for both system preferences. For example, update PatronSelfRegistration to say that even when set to Allow, the link will not display if PatronSelfRegistrationDefaultCategory is incorrectly set. Then update PatronSelfRegistrationDefaultCategory and give options of common patron categories.
Comment 4 Jonathan Druart 2016-01-14 08:38:29 UTC
Lowering the severity as it comes from a configuration issue.
Comment 5 Katrin Fischer 2023-08-28 20:40:31 UTC
(In reply to Aleisha Amohia from comment #3)
> (In reply to Marc Véron from comment #2)
> 
> > - not display the self registration link if PatronSelfRegistration is set
> > and PatronSelfRegistrationDefaultCategory is wrong or does not exist
> 
> I think this is probably the best option, as well as updating the
> descriptions for both system preferences. For example, update
> PatronSelfRegistration to say that even when set to Allow, the link will not
> display if PatronSelfRegistrationDefaultCategory is incorrectly set. Then
> update PatronSelfRegistrationDefaultCategory and give options of common
> patron categories.

This has both been implemented since :)