0

I've created two input fields and a dropdown menu in the typo3 backend. When I click the save button I get the error message:

   Doctrine\DBAL\Exception\InvalidFieldNameException

    An exception occurred while executing 'SELECT `inputfield1` FROM `tt_content` WHERE `uid` = ?' with params [1]: Unknown column 'inputfield1' in 'field list'

In my ext_tables.sql I created the table with the following sql statement:

    CREATE TABLE tt_content (
        inputfield1 varchar(255) DEFAULT '' NOT NULL,
        inputfield2 varchar(255) DEFAULT '' NOT NULL,
        ddOne varchar(255) DEFAULT '' NOT NULL
    );

In Configuraion/TCA&Overrides/tt_content.php I created the three fields:

    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', array(
'inputfield1' => array(
    'label' => 'Saschas Test',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'max' => 255,
        'eval' => 'trim,nospace'
    ),
),
'inputfield2' => array(
    'label' => 'Noch ein Test',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'max' => 255,
        'eval' => 'trim,nospace'
    ),
),
'ddOne' => array(
    'label' =>'My dropdownMenu',
    'exclude' => 1,
    'renderType' => 'selectSingle',
    'config' => array(
        'type' => 'select',
        'items' => [
            ['Author Jahr Titel'],
            ['Titel Author Jahr'],
            ['Jahr Titel Author']
    ]
        )
    )
)

Why does the mapping to the table tt_content not work here? Thanks in advance.

2
  • did you run the Database compare tool? If TYPO3v9 Under maintenance. Otherise On the install tool Commented Jan 15, 2020 at 11:33
  • let me add it as an answer and then you can acccept it Commented Jan 15, 2020 at 11:40

1 Answer 1

3

If an extension is already installed, TYPO3 does not know if new columns have been defined and we have to do it manually.

TYPO3 v9

Under Maintenance and the 'card' Analyze Database Structure Database click Analyse Database

TYPO3 v8, v7, v6

Under the install tool Module, select the Important actions and then Analyse Database

Best regards

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.