Hi community, I am using Koha 3.14.04 under Ubuntu 12.04. There is an error while I try edit Printer profle. Home › Tools › Patron card creator › Printer profiles › Edit Printer Profile After click save button, screen shows fellowing message: --> Software error: Can't call method "save" without a package or object reference at /usr/share/koha/intranet/cgi-bin/patroncards/edit-profile.pl line 72. For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. <-- Can someone give me a hand. -- Wishing you all the best. . . . Anthony Mao 毛慶禎 +886 2 29052334 (voice) + 886 2 29017405 (FAX)
Anthony Mao wrote:
I am using Koha 3.14.04 under Ubuntu 12.04. [...] Can't call method "save" without a package or object reference at /usr/share/koha/intranet/cgi-bin/patroncards/edit-profile.pl line 72.
Here's a worked example of debugging: So I think that file looks like http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=patroncards/edit-p... and line 72 is in: 70 else { # if no label_id, this is a new layout so insert it 71 $profile = C4::Patroncards::Profile->new(@params); 72 $profile->save(); 73 } So looking at C4::Patroncards::Profile to see why new() might fail: http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/Patroncards/Pro... 17 sub new { 18 my $self = shift; 19 push @_, "creator", $me; 20 return $self->SUPER::new(@_); 21 } which means looking at the base class named in 6 use base qw(C4::Creators::Profile); which is http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/Creators/Profil... and its new function starts like this: 58 sub new { 59 my $invocant = shift; 60 if (_check_params(@_) eq 1) { 61 return -1; 62 } ... So there's two problems here: a. it doesn't like your parameters. Look earlier in that last link to see the rules for checking parameters. If you pick parameters which pass the tests, I suspect it will work without an error. b. edit-profile.pl isn't checking whether it gets a -1 back from new() and it should. This is probably bug http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10870 which I've just explained this on. Thanks for your help in isolating this bug! -- MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op http://koha-community.org supporter, web and library systems developer. In My Opinion Only: see http://mjr.towers.org.uk/email.html Available for hire (including development) at http://www.software.coop/
participants (2)
-
Anthony Mao -
MJ Ray