Project

General

Profile

Actions

Bug #88853

open

Updating relations of translated domain objects does not work if they already exist

Added by Anton Fries almost 5 years ago. Updated 5 months ago.

Status:
New
Priority:
Should have
Category:
Extbase + l10n
Target version:
Start date:
2019-07-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
extbase, translation, relation, sql-error
Complexity:
medium
Is Regression:
Sprint Focus:

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.


Files

gwcatalog.zip (26.4 KB) gwcatalog.zip Anton Fries, 2019-08-06 10:07
Actions

Also available in: Atom PDF