#88853Updating relations of translated domain objects does not work if they already exist
Description
Hey,
for my product import i must to sync relations of translated domain object models to every translated record. TYPO3 does this already right if i click on the “Save”-Button in the backend, because in my TCA configuration its set to “l10n_exclude”. But manually saving does not work for > 2500 products on a regular basis.
It works for the first time to insert m:n-relations, but for every next try it tries to insert the value, which of course already exists instead of checking for an already existing relation. Is it possible to quickly fix this or just ignore the sql error and continue with my import? Ignoring would be fine, if i only add relations instead of updating them. Exception: TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException ]
Duplicate entry ’2636-13674’ for key ‘PRIMARY’.
My current solution is to just delete all relations via sql before my import starts:
DELETE FROM tx_gwproductcatalog_product_category_mm WHERE uid_local IN (SELECT uid FROM tx_gwproductcatalog_domain_model_product WHERE sys_language_uid != 0);
I attached the error log calling this from a backend module.
Reviews 1
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] Updating relations of translated domain objects does not work if they already exist Resolves: #88853 Releases: main