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

Mads Brunn mads at typoconsult.dk
Wed Oct 24 13:12:17 CEST 2007


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




More information about the TYPO3-dev mailing list