contao/issues — Issue #4: pageTree Widget, dataContainer != Table
Author: importer
Created: 2011-11-23 15:35:00+00:00
State: open
Labels: Backend, Defect

I found a problem in Widget PageTree on my TL 2.6beta2, it might also exist on older version.

The PageTree generateAjax() does not work if you don't use dataContainer Table. I have tried to add a page tree to the settings, and you'll get a Database error.

Here's what I patched on line 163ff of PageTree.php:

```
// Load current values
$this->loadDataContainer($this->strTable);
if ($GLOBALS['TL_DCA'][$this->strTable]['config']['dataContainer'] == 'File')
{
if (strlen($GLOBALS['TL_CONFIG'][$strField]))
{
$this->varValue = $GLOBALS['TL_CONFIG'][$strField];
}
}
elseif ($this->Database->fieldExists($strField, $this->strTable))
{
$objField = $this->Database->prepare("SELECT " . $strField . " FROM " . $this->strTable . " WHERE id=?")
->limit(1)
->execute($this->strId);

if ($objField->numRows)
{
$this->varValue = deserialize($objField->$strField);
}
}
```

--- _Originally created by andreas.schempp on August 18th, 2008, at 07:05pm_