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-profile.pl;h=6189cb3f6c76ff208f93e60799ca0ecef3cec9df;hb=1b1f24fbed0310df38036153a8283bf6a37fe9b3
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/Profile.pm;h=4842b3f3f5213a9c2487411fa4a415e1c1f45b42;hb=1b1f24fbed0310df38036153a8283bf6a37fe9b3

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/Profile.pm;h=a063aaf87f65f73a30d80cd7795bc696c5fb9a1b;hb=1b1f24fbed0310df38036153a8283bf6a37fe9b3

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/
_______________________________________________
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
http://lists.katipo.co.nz/mailman/listinfo/koha

Reply via email to