WebGUI
      Click here to register.
      
View Cart (0)
IRC banner

View All Tickets
joinClass property of getLineage does not include all tables  (#3717)
Issue

The joinClass property should include all tables defined by the definition method. However it only includes the 'top' table. Ie. if you use joinClass => 'WebGUI::Asset::Post::Thread', it only joins Thread, and not Thread and Post as it should.

To fix apply the attached patch to WebGUI::AssetLineage which changes:

    # deal with custom joined tables if we must
    my $tables = "asset left join assetData on asset.assetId=assetData.assetId ";
    if (exists $rules->{joinClass}) {
        my $className = $rules->{joinClass};
        my $cmd = "use ".$className;
        eval ($cmd);
        $self->session->errorHandler->fatal("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@);
        foreach my $definition (@{$className->definition($self->session)}) {
            unless ($definition->{tableName} eq "asset") {
                my $tableName = $definition->{tableName};
                $tables .= " left join $tableName on assetData.assetId=".$tableName.".assetId and assetData.revisionDate=".$tableName.".revisionDate";
            }
            last;
        }
    }

into:

 

    # deal with custom joined tables if we must
    my $tables = "asset left join assetData on asset.assetId=assetData.assetId ";
    if (exists $rules->{joinClass}) {
        my $className = $rules->{joinClass};
        my $cmd = "use ".$className;
        eval ($cmd);
        $self->session->errorHandler->fatal("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@);
        foreach my $definition (@{$className->definition($self->session)}) {
            unless ($definition->{tableName} eq "assetData") {
                my $tableName = $definition->{tableName};
                $tables .= " left join $tableName on assetData.assetId=".$tableName.".assetId and assetData.revisionDate=".$tableName.".revisionDate";
            }
            else {
                last;
            }
        }
    }

Solution Summary
Comments
Graham
0
4/11/2008 9:45 am

Fixed in 7.5.

Details
Ticket Status Closed  
Rating0.0 
Submitted Bymartink 
Date Submitted2008-04-10 
Assigned To unassigned  
Date Assigned2008-10-10 
Assigned By 
Severity Critical (mostly not working)  
What's the bug in? WebGUI Stable  
WebGUI / WRE Version 7.4.31  
URLbugs/tracker/joinclass-property-of-getlineage-does-not-include-all-tables
Keywords
Related Files
Ticket History