Bug #17224
closedMapping problem in content element selectboxes
0%
Description
There is a problem with the mapping, when integrating external tables via the DBAL and showing a field with a selectbox.
In my case, i want to have an album with categories. These categories come from an second external table, that is mapped via DBAL too.
The first task is to display both albums and categories in an backend sysfolder. That works fine in both configuration, with variable mapping to a tablefield called 'page_id' and fixed mapping to a value. In both options the Listview shows the correct amount of albums and categories in the backend.
Second task is to be able to change the category of an album. Therefor i have configured the field in the tca.php to be a 'select' with foreign table pre_categories. Now it turns out, that there is something wrong in the mapping, because everytime i get a db failure and in the selectbox you can read [ Current value not allowed (3) ] even though the category is displayed in the Listview.
===== Example Configuration =====
$confArr['sysfolderID'] = 24;
$confArr['Prefix'] = 'non_';
===== Mapping in localconf =====
'pre_albums' => array (
'mapTableName' => $confArr['Prefix'] . 'albums',
'mapFieldNames' => array(
'pid' => 'page_id',
'uid' => 'aid',
)
),
'pre_categories' => array (
'mapTableName' => $confArr['Prefix'] . 'categories',
'mapFieldNames' => array(
'pid' => $confArr['sysfolderID'],
'uid' => 'cid',
)
),
===== TCA Configuration =====
'category' => Array (
'exclude' => 0,
'label' => 'Album Category',
'config' => Array (
'type' => 'select',
'items' => Array (
Array ('[ no Category ]', 0),
),
'size' => 1,
'maxitems' => 1,
'foreign_table' => 'pre_categories',
'foreign_table_where' => '',
)
),
===== Database Failure =====
0 SELECT pre_categories.cid, pre_categories.name
FROM pre_categories, pages
WHERE
pages.uid = pre_categories.pid AND pages.deleted = 0 AND 1 = 1
1 Unknown column 'pre_categories.pid' in 'where clause'
(issue imported from #M5465)
Files