[TYPO3-dev] IRRE - SQL error: Unknown column

Boros Attila attila at thebat.net
Mon Apr 26 17:20:12 CEST 2010


Hi,

I'm getting this error when I try to save a new "hotel" record:

2: SQL error: 'Unknown column 'services' in 'field list'' (tx_chrsites_hotels:5)

Which is correct, there is no 'services' field in the
tx_chrsites_hotels table, it is defined as an inline relation in
tca.php:

$TCA['tx_chrsites_hotels'] = array (
        'ctrl' => $TCA['tx_chrsites_hotels']['ctrl'],
        'interface' => array (
                'showRecordFieldList' => 'name,code,pictures,description,services,paymentopts,meeting_rooms,meeting_equipment'
        ),
        'feInterface' => $TCA['tx_chrsites_hotels']['feInterface'],
        'columns' => array (
                  .
                  .
                  .

                'services' => array (
                        'exclude' => 0,
                        'label' => 'LLL:EXT:chrsites/locallang_db.xml:tx_chrsites_hotels.services',
                        'config' => array (
                                'type' => 'inline',
                                'foreign_table' => 'tx_chrsites_hotels_services',
                                'foreign_field' => 'id_hotel',
                                'foreign_sortby' => 'sorting',
                                'foreign_label' => 'Service',
                                'appearance' => array(
                                        'collapseAll' => 0,
                                ),
                        )
                ),
                  .
                  .
                  .

        ),
        'types' => array (
                '0' => array('showitem' => 'name;;;;1-1-1, code, pictures, description;;;richtext[]:rte_transform[mode=ts], services, paymentopts, meeting_rooms, meeting_equipment;;;richtext[]:rte_transform[mode=ts]')
        ),
        'palettes' => array (
                '1' => array('showitem' => '')
        )
);

There are more fields which I have omitted.

$TCA['tx_chrsites_hotels_services'] = array (
        'ctrl' => $TCA['tx_chrsites_hotels_services']['ctrl'],
        'interface' => array (
                'showRecordFieldList' => 'id_hotel,id_service'
        ),
        'feInterface' => $TCA['tx_chrsites_hotels_services']['feInterface'],
        'columns' => array (
                'id_hotel' => array (
                        'exclude' => 0,
                        'label' => 'LLL:EXT:chrsites/locallang_db.xml:tx_chrsites_hotels_services.hotel_name',
                        'config' => array (
                                'type' => 'select',
                                'foreign_table' => 'tx_chrsites_hotels',
                                'maxitems' => 1,
                        )
                ),
                'id_service' => array (
                        'exclude' => 0,
                        'label' => 'LLL:EXT:chrsites/locallang_db.xml:tx_chrsites_hotels_services.service_name',
                        'config' => array (
                                'type' => 'select',
                                'foreign_table' => 'tx_chrsites_services',
                                'maxitems' => 1,
                                'localizeReferences' => 1,
                        )
                )
        ),
        'types' => array (
                '0' => array('showitem' => 'id_hotel, id_service')
        ),
        'palettes' => array (
                '1' => array('showitem' => '')
        )

);

$TCA['tx_chrsites_services'] = array (
        'ctrl' => $TCA['tx_chrsites_services']['ctrl'],
        'interface' => array (
                'showRecordFieldList' => 'sys_language_uid,l10n_parent,l10n_diffsource,name,pictogram'
        ),
        'feInterface' => $TCA['tx_chrsites_services']['feInterface'],
        'columns' => array (
                'sys_language_uid' => array (
                        'exclude' => 1,
                        'label'  => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
                        'config' => array (
                                'type'                => 'select',
                                'foreign_table'       => 'sys_language',
                                'foreign_table_where' => 'ORDER BY sys_language.title',
                                'items' => array(
                                        array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
                                        array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
                                )
                        )
                ),
                'l10n_parent' => array (
                        'displayCond' => 'FIELD:sys_language_uid:>:0',
                        'exclude'     => 1,
                        'label'       => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
                        'config'      => array (
                                'type'  => 'select',
                                'items' => array (
                                        array('', 0),
                                ),
                                'foreign_table'       => 'tx_chrsites_services',
                                'foreign_table_where' => 'AND tx_chrsites_services.pid=###CURRENT_PID### AND tx_chrsites_services.sys_language_uid IN (-1,0)',
                        )
                ),
                'l10n_diffsource' => array (
                        'config' => array (
                                'type' => 'passthrough'
                        )
                ),
                'name' => array (
                        'exclude' => 0,
                        'label' => 'LLL:EXT:chrsites/locallang_db.xml:tx_chrsites_services.name',
                        'config' => array (
                                'type' => 'input',
                                'size' => '30',
                                'max' => '100',
                                'eval' => 'required,trim,unique',
                        )
                ),
                'pictogram' => array (
                        'exclude' => 0,
                        'label' => 'LLL:EXT:chrsites/locallang_db.xml:tx_chrsites_services.pictogram',
                        'config' => array (
                                'type' => 'group',
                                'internal_type' => 'file',
                                'allowed' => 'gif,png,jpeg,jpg',
                                'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
                                'uploadfolder' => 'uploads/tx_chrsites',
                                'show_thumbs' => 1,
                                'size' => 1,
                                'minitems' => 1,
                                'maxitems' => 1,
                        )
                ),
        ),
        'types' => array (
                '0' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, name, pictogram')
        ),
        'palettes' => array (
                '1' => array('showitem' => '')
        )
);

Can you tell me what is wrong with that?

Thanks in advance,
Attila





More information about the TYPO3-dev mailing list