Can't load Release

View: New views
4 Messages — Rating Filter:   Alert me  

Can't load Release

by Niklas B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello
I've gotten stuck on an error message. Im trying to create Release objects.
As an example I've tried the following code:

my $release=MusicBrainz::Server::Release->new($sql);
$release->SetMBId('063db571-a532-44df-8375-e93826adc996');
$release->LoadFromId();


When I do LoadFromId() an error message is printed:

error: Can't locate object method "errstr" via package "Sql" at /home/mbserver/svn/mb_server/cgi-bin/Sql.pm line 392.
context: 
... 
388: 
389: return $row unless $@;
390: 
391: my $err = $@;
392: $this->{ERR} = $this->{DBH}->errstr;
393: cluck("Failed query:\n '$query'\n (@params)\n$err\n")
394: unless ($this->{Quiet});
395: die $err;
396: }
... 
code stack: /home/mbserver/svn/mb_server/cgi-bin/Sql.pm:392
/home/mbserver/svn/mb_server/cgi-bin/MusicBrainz/Server/Release.pm:662
/home/mbserver/svn/mb_server/htdocs/comp/collection:48
/usr/share/perl5/HTML/Mason/Component.pm:135
/home/mbserver/svn/mb_server/htdocs/show/collection/index.html:20
/usr/share/perl5/HTML/Mason/Component.pm:135

I have no idea what is wrong. The $sql variable Im sending is okay - I've used it successfully in another function.
The MBID is a valid release MBID.

Can anyone see what Im doing wrong?

/Niklas


_______________________________________________
MusicBrainz-devel mailing list
MusicBrainz-devel@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel

Re: Can't load Release

by Lukáš Lalinský :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dňa Št, 2008-07-03 o 22:19 +0200, Niklas Berglund napísal:
> Hello
> I've gotten stuck on an error message. Im trying to create Release
> objects.
> As an example I've tried the following code:
>
>
> my $release=MusicBrainz::Server::Release->new($sql);

You probably wanted:

my $release=MusicBrainz::Server::Release->new($mb->{DBH});

or:

my $release=MusicBrainz::Server::Release->new($self->{DBH});

depending on where in the code you are doing this.

> $release->SetMBId('063db571-a532-44df-8375-e93826adc996');
> $release->LoadFromId();

Lukas



_______________________________________________
MusicBrainz-devel mailing list
MusicBrainz-devel@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel

signature.asc (196 bytes) Download Attachment

Re: Can't load Release

by Lukáš Lalinský :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dňa Pi, 2008-07-04 o 07:56 +0200, Lukáš Lalinský napísal:

> Dňa Št, 2008-07-03 o 22:19 +0200, Niklas Berglund napísal:
> > Hello
> > I've gotten stuck on an error message. Im trying to create Release
> > objects.
> > As an example I've tried the following code:
> >
> >
> > my $release=MusicBrainz::Server::Release->new($sql);
>
> You probably wanted:
>
> my $release=MusicBrainz::Server::Release->new($mb->{DBH});
Oh and one more thing, you definitely wanted ' = ', not '=' :)

Lukas



_______________________________________________
MusicBrainz-devel mailing list
MusicBrainz-devel@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel

signature.asc (196 bytes) Download Attachment

Re: Can't load Release

by Niklas B :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> You probably wanted:
>
> my $release=MusicBrainz::Server::Release->new($mb->{DBH});
>
> or:
>
> my $release=MusicBrainz::Server::Release->new($self->{DBH});

Ohh yea. Thank you.


> Oh and one more thing, you definitely wanted ' = ', not '=' :)

Alright. I'll change the coding style.

/Niklas

_______________________________________________
MusicBrainz-devel mailing list
MusicBrainz-devel@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel
LightInTheBox - Buy quality products at wholesale price!
 
Creative Commons EFF GPL LGPL
Original Design|vacubomb.com Contact Details Server Version: RELEASE-20060712