contao/issues — Issue #344: eliminateNestedPages function in controller.php not accepting 2nd parameter
Author: importer
Created: 2011-11-24 12:39:51+00:00
State: open
Labels: Defect, framework

On line: 199 in DC_Table.php the call is (ROOT,TABLE) however the actual function is only receiving (ROOT) and fixed to use table tl_page. This does not allow for other files (I.E. tl_taxonomy) to have roots established.

Coding the function this way fixes the issue:

```
protected function eliminateNestedPages($arrPages,$table)
{
if (!is_array($arrPages) || count($arrPages) < 1)
{
return array();
}

$nested = array();
$arrPages = array_intersect($this->getChildRecords(0, $table), $arrPages);

foreach ($arrPages as $page)
{
$nested = array_merge($nested, $this->getChildRecords($page, $table));
}

return array_values(array_diff($arrPages, $nested));
}

```

--- _Originally created by bumforaliving on December 13th, 2008, at 12:15am (ID 344)_