diff --git a/lib/Doctrine/Node.php b/lib/Doctrine/Node.php index 930777197..618f91d4e 100644 --- a/lib/Doctrine/Node.php +++ b/lib/Doctrine/Node.php @@ -68,7 +68,22 @@ class Doctrine_Node implements IteratorAggregate { $this->record = $record; $this->options = $options; - $this->_tree = $this->record->getTable()->getTree(); + + // Make sure that the tree object of the root component is used in the case + // of column aggregation inheritance. + $class = $record->getTable()->getComponentName(); + $table = $record->getTable(); + if ($table->getOption('inheritanceMap')) { + $subclasses = $table->getOption('subclasses'); + while (in_array($class, $subclasses)) { + $class = get_parent_class($class); + } + } + if ($class != $table->getComponentName()) { + $this->_tree = $table->getConnection()->getTable($class)->getTree(); + } else { + $this->_tree = $table->getTree(); + } } /** diff --git a/tests/run.php b/tests/run.php index 711152530..a59b16224 100644 --- a/tests/run.php +++ b/tests/run.php @@ -399,7 +399,7 @@ if (PHP_SAPI === 'cli') { $reporter = new MyReporter(); } -$argv = $_SERVER['argv']; +$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array(); array_shift($argv); $options = parseOptions($argv);