TYPO3 6.1.3, sr_feuser_register 3.0.2
Ich beschäftige mich seit ca. 10 Stunden mit zwei zusätzlichen Feldern für den fe_user. Ich habe alle Tutorials, Foreneinträge etc. abgearbeitet und doppelt geprüft. Es will nicht.
Ich habe zwei neue Felder in der fe_users erstellt. "collaboration" ist der Ext-Key, "cnfunction" das erste Feld, ein Input, "cncountry" das zweite Feld, ein select.
In der ext_localconf.php habe ich folgendes hinterlegt:
if (TYPO3_MODE == 'FE') {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sr_feuser_register']['extendingTCA'][] = 'collaboration';
}
In der ext_tables.php steht folgendes:
$tmp_collaboration_columns = array(
'cnfunction' => array(
'exclude' => 0,
'label' => 'LLL:EXT:collaboration/Resources/Private/Language/locallang_db.xlf:tx_collaboration_domain_model_user.cnfunction',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'cncountry' => array(
'exclude' => 1,
'label' => 'LLL:EXT:collaboration/Resources/Private/Language/locallang_db.xlf:tx_collaboration_domain_model_user.cncountry',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_collaboration_domain_model_country',
'minitems' => 0,
'maxitems' => 1,
),
),
);
t3lib_extMgm::addTCAcolumns('fe_users',$tmp_collaboration_columns);
$TCA['fe_users']['columns'][$TCA['fe_users']['ctrl']['type']]['config']['items'][] = array('LLL:EXT:collaboration/Resources/Private/Language/locallang_db.xlf:fe_users.tx_extbase_type.Tx_Collaboration_User','Tx_Collaboration_User');
#$TCA['fe_users']['types']['1']['showitem'] = $TCA['fe_users']['types']['1']['showitem'];
#$TCA['fe_users']['types']['1']['showitem'] .= ',--div--;LLL:EXT:collaboration/Resources/Private/Language/locallang_db.xlf:tx_collaboration_domain_model_user,';
#$TCA['fe_users']['types']['1']['showitem'] .= 'cnfunction, cncountry';
t3lib_extMgm::addToAllTCATypes('fe_users',',--div--;LLL:EXT:collaboration/Resources/Private/Language/locallang_db.xlf:tx_collaboration_domain_model_user,cnfunction, cncountry');
Nach einem Check im BE funktioneren die beiden Felder ohne Probleme. Die Eingabe lässt sich speichern und auch das Select behält seinen Wert.
In den Konstanten habe ich folgendes gesetzt:
plugin.tx_srfeuserregister_pi1.formFields = password, gender, terms_acknowledged, first_name, last_name, email, address, city, cncountry, cnfunction, zip, telephone, language, title, company, module_sys_dmail_html
plugin.tx_srfeuserregister_pi1.requiredFields = password, first_name, last_name, email, terms_acknowledged, cnfunction
Im TypoScript Setup kommt folgendes zum tragen:
plugin.tx_srfeuserregister_pi1 {
extraLabels = cnfunction, cncountry
_LOCAL_LANG {
de {
missing_cnfunction = Funktion ist ein Pflichtfeld
cnfunction = Funktion
cncountry = Land
}
}
create {
evalValues.cnfunction =
evalValues.cncountry
}
}
Das HTML Template für die Felder schaut so aus:
<!-- ###SUB_INCLUDED_FIELD_cnfunction### -->
<div class="register-labelfield">
<!-- ###SUB_REQUIRED_FIELD_cnfunction### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_CNFUNCTION###</p>
<!-- ###SUB_REQUIRED_FIELD_cnfunction### -->
<label for="tx-srfeuserregister-pi1-cnfunction">###LABEL_CNFUNCTION###<span class="orange">*</span></label>
<input id="tx-srfeuserregister-pi1-cnfunction" type="text" size="40" maxlength="50" title="###TOOLTIP_cnfunction###" name="FE[fe_users][cnfunction]" class="tx-srfeuserregister-pi1-text" /> <div class="clear"></div>
</div>
<!-- ###SUB_INCLUDED_FIELD_cnfunction### -->
<!-- ###SUB_INCLUDED_FIELD_cncountry### -->
<div class="register-labelfield">
<!-- ###SUB_REQUIRED_FIELD_cncountry### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_CNCOUNTRY###</p>
<!-- ###SUB_REQUIRED_FIELD_cncountry### -->
<label for="tx-srfeuserregister-pi1-cncountry">Land<span class="orange">*</span></label>
###TCA_INPUT_cncountry###
<div class="clear"></div>
</div>
<!-- ###SUB_INCLUDED_FIELD_cncountry### -->
Und nun die Symptome:
Bei der Registrierung erkennt die Ext das cnfunction als Pflichtfeld an. Wenn es leer ist, geht es nicht weiter. Die Fehlermeldung dazu wird aber nicht ausgegeben. Auch wenn ein Wert im Feld steht und ein anderes Pflichfeld leer ist, wird nach dem absenden cnfunction nicht mehr gefüllt. Das ist darin begründet dass die js Zeile updateForm() im Quelltext nicht für dieses Feld vorhanden ist.
Das Select feld wird im FE bei einen required-Fehler des Formulars allerdings auf den Wert gesetzt, welcher ausgefüllt wurde.
Allerdings werden beide Werte nicht in der Tabelle gespeichert. Ich bin wirklich ratlos und bräuchte dringend Hilfe.
Besten Dank!