[TYPO3-mvc] Updating a list empties it!

Xavier Perseguers xavier at typo3.org
Tue May 10 11:44:35 CEST 2011


Hi,

> Context:
> I have companies providing services, for each service I have contacts.
>
> Problem:
> When I add a contact within BE, it shows up correctly. When I do the
> same in FE, the list of contacts is emptied.
>
> How it's done:
> CompanyController->show() provides the list of services and the
> corresponding contacts, I may edit a given service which leads to an
> edit action in ServiceController. My ServiceController has an addContact
> action which does this:
>
> $service->addContact($contact);
> $this->serviceRepository->update($service);
>
> and then redirects to CompanyController->show().
>
> I tracked down the update into Persistence/Backend, within method
> replaceObject. All is fine but in the end my service has no more
> contacts anymore!

OK, I found the problem, now I have to understand it ;-)

Actually my contacts get added to the _mm table successfully but 
Extbase, for some reason, does not populate column "tablenames" with 
"fe_users" this leads to "unlinked" records and thus the repository (and 
TYPO3 in BE) does not see those related records anymore. It does that 
even for existing relations, not only for the newly added contact.

Furthermore, column "contacts" of table "services" is set to the number 
of contacts when using TYPO3 BE but is set to 0 when using Extbase in 
FE. This does not impact anything in regard to the relations but it's a 
difference of behavior.

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-typo3v4mvc mailing list