[svn:p5ee] r9231 - p5ee/trunk/App-Repository/lib/App/Repository

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Mon Mar 12 12:57:23 2007
New Revision: 9231

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm

Log:
enhance repository redirection _get_default_columns()

Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	Mon Mar 12 12:57:23 2007
@@ -523,8 +523,21 @@
     elsif (!$columns || $columns eq "physical") {
         $columns = $table_def->{phys_columns};
     }
-    $columns = [] if (!$columns || ref($columns) ne "ARRAY");
-    #die "Unknown default columns [$columns]" if (ref($columns) ne "ARRAY");
+    if (!$columns || ref($columns) ne "ARRAY") {
+        my $table_def = $self->{table}{$table};
+        my $repname = $table_def->{repository};
+        my $realtable = $table_def->{table} || $table;
+        if (defined $repname && $repname ne $self->{name}) {
+            my $rep = $self->{context}->repository($repname);
+            $columns = $rep->_get_default_columns($realtable);
+        }
+        elsif (defined $realtable && $realtable ne $table) {
+            $columns = $self->_get_default_columns($realtable);
+        }
+    }
+    if (!$columns || ref($columns) ne "ARRAY") {
+        $columns = [];
+    }
     &App::sub_exit($columns) if ($App::trace);
     return($columns);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.