[TYPO3-mvc] Update relations to inline objects

Jochen Rau jochen.rau at typoplanet.de
Fri Mar 2 15:22:55 CET 2012


Hi Dirk,

On 2012-03-02, Dirk Rauscher <dr_typo3 at itb-institut.de> wrote:
> my 'patient' object has a property 'protocol'. In TCA the 'protocol' is 
> implemented as inline relation and only 1 protocol per patient is allowed.
>
> When adding a protocol to a patient in the backend this rule is complied.
>
> But when I call the setProtocol($protocol) method of the patient object 
> with a new protocol object, the relation to the previous protocol is kept.

Extbase does not interpret the TCA validation rules (by purpose). You might want to either
- add a validation rule to your property in the model,
- change your relation type to 1:1 (which it actually is),
- or remove the old object bevor adding a new one.

> I've set config.tx_extbase.persistence.updateReferenceIndex = 1 but it 
> has no effect on this issue.

TYPO3 uses the reference index internally to show related records. It's shown in the
list view as number of relations. Extbase updates the index but does nothing with it.

Best
Jochen


-- 
Every nit picked is a bug fixed


More information about the TYPO3-project-typo3v4mvc mailing list