Skip Menu |
 

This queue is for tickets about the Tangram CPAN distribution.

Report information
The Basics
Id: 25517
Status: stalled
Priority: 0/
Queue: Tangram

People
Owner: Nobody in particular
Requestors: MLAWREN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.10
Fixed in: (no value)



Subject: Missing inflation of BackRef columns
Download (untitled) / with headers
text/plain 1.9k
Given the following schema: my $schema = { Content => { fields => { string => [qw(title)], iarray => { children => { class => 'Content', back => 'parent', coll => 'parent', deep_update => 1, }, }, }, }, }; And the following activities: my $gen = new Class::Tangram::Generator $schema; my $content1 = $gen->new(’Content’); my $content2 = $gen->new(’Content’); push(@{$content1->children}, $content2); $storage->insert($content1); Then at this point in time $content2->parent refers to $content1 just fine. However, if I later do my $content2 = $storage->load(id2); then $content2->parent returns undef. Inspecting $content2 with Data::Dumper shows a 'parent' key in the hashref that points to the right structure/object, but the method doesn't seem to do the right thing. It may be that this is actually a Class::Tangram issue? I took a quick look and in the %defaults hash there is this: yaml => { check_func => \&check_nothing, load => "Tangram/YAML.pm", }, backref => { check_func => \&check_nothing, }, storable => { check_func => \&check_nothing, load => "Tangram/Storable.pm", }, idbif => { check_func => \&check_nothing, load => "Tangram/IDBIF.pm", }, BackRef doesn't have a function to 'load' the data? I tried setting this to the following but with no luck: load => "Tangram/BackRef.pm", If this is not a simple issue and you need a test script let me know By the way, I'm using Tangram::Compat and I'm having this problem under both a persistent Perl environment (Speedy CGI) and the normal one. Cheers, Mark.
RT-Send-CC: nomad [...] null.net
Download (untitled) / with headers
text/plain 1.4k
Hmm.. Having just taken a better look at the open tickets, and in particular http://rt.cpan.org/Ticket/Display.html?id=24851, I applied the patches and have changed the problem, but not solved it. Let's change the schema to: my $schema = { Content => { + bases => [qw(Base)], fields => { string => [qw(title)], iarray => { children => { class => 'Content', back => 'parent', coll => 'parent', deep_update => 1, }, }, }, }, }; Show quoted text
> And the following activities: > > my $gen = new Class::Tangram::Generator $schema; > my $content1 = $gen->new(’Content’); > my $content2 = $gen->new(’Content’); > > push(@{$content1->children}, $content2); > $storage->insert($content1); > > Then at this point in time $content2->parent refers to $content1
If I do: my $content2 = $storage->load(id2); then $content2->parent (I think - croak isn't showing the full call tree) produces: Attempt to instantiate an abstract type Base at /usr/share/perl5/Tangram/Schema.pm line 30 The thing is, I know for sure that I'm not trying to instantiate the abstract Base class, and the patch from 24851 doesn't look like it could have caused this either. But I really didn't change anything else in between. I bet you are now definately going to ask for a test case... :) Cheers, Mark.
Subject: Re: [rt.cpan.org #25517] Missing inflation of BackRef columns
Date: Mon, 19 Mar 2007 16:58:52 +1200
To: bug-Tangram [...] rt.cpan.org
From: Sam Vilain <sam [...] vilain.net>
Download (untitled) / with headers
text/plain 873b
via RT wrote: Show quoted text
> BackRef doesn't have a function to 'load' the data?
No, it happens via demand-loaded references; see Tangram::Lazy::*. You need to use Class::Tangram::quickdump (ie, $object->quickdump) to see them before they are "followed". Yeah, get a test script together, be sure to play with what you see with TANGRAM_TRACE set, and I'll take a look. Pretty soon I'll have open push access to utsl.gen.nz git... so you'll be able to push your own test scripts and I'll just merge them :) Sam. Show quoted text
> I tried setting this > to the following but with no luck: > > load => "Tangram/BackRef.pm", > > If this is not a simple issue and you need a test script let me know > > By the way, I'm using Tangram::Compat and I'm having this problem under > both a persistent Perl environment (Speedy CGI) and the normal one. > > > Cheers, > Mark. >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.