Subject: | Missing inflation of BackRef columns |
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.