user2310852
user2310852

Reputation: 1674

After TYPO3 Update from 6.2 to 7.6 still errors in TCA?

I've made an update from TYPO3 CMS 6.2 to TYPO3 CMS 7.6.16. After a few problems with other extensions (tx_newsand third party ext.) and the changes in the TCA. Everything works fine after import live-dump ...

  1. Upgrade wizard / Database compare
  2. Update reference Index
  3. Flush Cache and empty typo3temp
  4. Deactivate and reactivate the Extensions with problems

Everything? Unfortunately, no. The extension doesn't work. I don't written the extension by myself. If I try to add a new data record in backend with this ext., I'll get this error:

An item in field form of table tx_blah_domain_model_job is not an array as expected

But the database comprare is finished. All tables are correct?!

typo3 database compare

Where's the problem? I know it's hard to analyze this without source code. There's a database field wrong, but why? It's the same database like before?

Where's the fault .. ext_tables.php or still sth. in TCA is wrong? I really need a tip .. its frustrating ..

EDIT: sys_log entry

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1439288036: An item in field form of table tx_blah_domain_model_job is not an array as expected | UnexpectedValueException thrown in file /typo3_src/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php in line 1264.

EDIT 2: I think, there must be sth. in typo3conf/ext/blah/Configuration/TCA/tx_blah_domain_model_job.php see TCA source code

and that's in line 1264

/**
 * Sanitize incoming item array
 *
 * Used by TcaSelectItems and TcaSelectTreeItems data providers
 *
 * @param mixed $itemArray
 * @param string $tableName
 * @param string $fieldName
 * @throws \UnexpectedValueException
 * @return array
 */
public function sanitizeItemArray($itemArray, $tableName, $fieldName)
{
    if (!is_array($itemArray)) {
        $itemArray = [];
    }
    foreach ($itemArray as $item) {
        if (!is_array($item)) {
            throw new \UnexpectedValueException(
                'An item in field ' . $fieldName . ' of table ' . $tableName . ' is not an array as expected',
                1439288036
            );
        }
    }

    return $itemArray;
}

Upvotes: 0

Views: 427

Answers (1)

Heinz Schilling
Heinz Schilling

Reputation: 2272

aTry to use this in the TCA tx_imappointments_domain_model_job.php

        'form' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:im_appointments/Resources/Private/Language/locallang_db.xlf:tx_imappointments_domain_model_job.form',
            'config' => array(
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => array(array('', 0)),
                'foreign_table' => 'pages',
                'foreign_table_where' => ' AND pages.pid = 293',
                'minitems' => 0,
                'maxitems' => 1,
            ),
        ),

'items' in 'form' has to be a array how your error message said: https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Select.html#items

Upvotes: 1

Related Questions