typo3typo3-9.xpersistence-manager

PersistenceManager does not persist the last entry in TYPO3


first of all, i searched a lot but can't find a solution.

I wrote an Importer, which imports data from a xml file to TYPO3 via CommandController.

Basically everything works like charm, but the frontend does not display the second (and last) phonenumber, until i reopen the corresponding Object in the Backend and press "Save".

I did not change anything in the BE, just pressed "Save" once again.

What ive already tried:

Persist the datas more often, especially after adding the phoneNumbers(its a DataStorage Object).

with:

$this->thingsImportRepository->update($person);
$this->persistenceManager->persistAll();

As i said, everything is saved correctly, just the second phone number won't show up in the Frontend.

What could i have possibly done wrong?

Thanks!

BR, Martin


Solution

  • The solution basically just was a detail.

    All data had been persisted correctly. At first i thought it was a cache-issue.

    But:

    The Solution:

    The sorting_foreign property was not set correctly, so the sorting were everywhere 0. After saving it in the Backend the sorting was correctly numbered. Adding the setForeignSorting($sort); in the controller before persisting the object has fixed this issue