[TYPO3-dev] Fields in the TCA that does not exist in the DB

Steffen Kamper steffen at sk-typo3.de
Wed Oct 24 13:20:05 CEST 2007


"Mads Brunn" <mads at typoconsult.dk> schrieb im Newsbeitrag 
news:mailman.1.1193224279.8442.typo3-dev at lists.netfielders.de...
> Hi Malte
>
> Malte Jansen skrev:
>> I can confirm this, you don't have to create the column.
>>
>> For displaying the form:
>> class tx_yourextension_tceform {
>>   getMainFields_preProcess($table, &$row, &$pObj) {
>>     if ($table == 'tx_yourextension_table') {
>>     $row["your_virtual_field_without_column"] = $some_value;
>>     }
>>   }
>> }
>>
>> Before saving the form:
>> class tx_yourextension_tcemain {
>>   function processDatamap_preProcessFieldArray(&$fieldArray, $table, $id, 
>> &$pObj) {
>>     if ($table == 'tx_yourextension_table') {
>>     $fieldArray["your_virtual_field_without_column"] = 0;
>>     }
>>   }
>> }
>>
>
> This won't work. After "getMainFields_preProcess" the tcemain will do a 
> simple check in the database for the current value of 
> "your_virtual_field_without_column" and this will cause a mysql error.
>
>
> ./mads

should work with
unset($fieldArray["your_virtual_field_without_column"]) instead of setting 
to 0

vg  Steffen 






More information about the TYPO3-dev mailing list