[TYPO3-dev] TCEmain hook for postprocessing data fails updating select fields
JoH asenau
info at cybercraft.de
Tue Apr 20 17:01:35 CEST 2010
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
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
More information about the TYPO3-dev
mailing list