[TYPO3-dev] TCEmain hook for postprocessing data fails updating select fields

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Tue Apr 20 17:11:14 CEST 2010


Thanks for your reply!

Of course the value should hold just the amount of assigned categories 
if a MM table is used, but in case of the tt_news record it's also 
working this way, so I'm wondering why is this and how to get this 
running also for the cal events?

Thanks,
Thomas

Am 20.04.2010 17:01, schrieb JoH asenau:
> Thomas "Thasmo" Deinhamer wrote:
>> Hello folks!
>>
>> When trying to update/postprocess a select field with a TCEmain hook,
>> I get the error:
>> "102: These fields are not properly updated in database: (category_id)
>> Probably value mismatch with fieldtype."
>>
>> This happens e.g. for the extension 'cal' when trying to set some
>> categories for an event by hand:
>> $fields['category_id'] = array(1,2);
>>
>> I even tried:
>> $fields['category_id'] = '1,2';
>
> category_id is INT(11) so the message is correct.
>
>> When doing the same for a tt_news record, setting some categories the
>> same way, everything works fine. (I guess TCEmain cares about the MM
>> table and handles the creation of the desired MM records etc.)
>
> Of course it does, so you have to do it accordingly:
> 1) Get the desired values
> 2) create according entries in the MM table.
> 3) Count the overall entries in the MM table
> 4) Write this value back to category_id
>
> This is default behaviour for MM related fields in TYPO3.
> The field itself contains just the current number of relations.
>
> HTH
>
> Joey
>




More information about the TYPO3-dev mailing list