cobwebch / external_import

Other
20 stars 16 forks source link

Hidden child records are considered as deleted, an therefore reimported #311

Closed presedo closed 9 months ago

presedo commented 9 months ago

When fetching existing records for "child records", the basic QueryBuilder restrictions are used. When the same thing is done for the main table, only the "deleted" restriction the take into account the "deleted" restriction.

This means that if an item is hidden, it's considered as not present, and is reimported.

What should be done :

in the method \Cobweb\ExternalImport\Domain\Repository\ChildrenRepository::prepareQueryBuilder()

after the line: $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); just add:

$queryBuilder->getRestrictions()
    ->removeAll()
    ->add(
        GeneralUtility::makeInstance(
                    \TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction::class
        )
    );
fsuter commented 9 months ago

Released with version 7.2.1 (https://github.com/cobwebch/external_import/releases/tag/7.2.1)