• Christian Kuhn's avatar
    [BUGFIX] Update ref-index when deleting new workspace relations · 1635721b
    Christian Kuhn authored and Benni Mack's avatar Benni Mack committed
    Adding an image to a workspace content element adds two
    sys_refindex entries: One for the sys_file_reference
    t3ver_state=-1 and one for the t3ver_state=1 record.
    Deleting the image reference again in workspaces only sets
    one of the two to deleted in sys_refindex, leading to orphan
    sys_refindex entries.
    The patch fixes this by adding a 'redo refindex' call at the
    appropriate place.
    There are more issues when 'discard changes' is used together with
    multi-level relations (tt_content->hotel->offer->price): Discard
    does not properly cascade in those cases, yet. The patch touches
    this as a side-effect and does not improve the situation. The .csv
    files are marked with @todo accordingly and will be fixed with further
    patches. Those scenarios are more seldom than a broken sys_refindex
    for FAL images which is the primary goal of this patch.
    Analyzing the test scenarios, the patch actually removes various
    rows from sys_refindex where the left part of the relation is set
    to deleted. This is correct and wanted: In the end we don't want
    sys_refindex to contain reference to deleted rows at all. This
    strategy will be further followed with other patches.
    Resolves: #61917
    Related: #67676
    Releases: master, 10.4
    Change-Id: I3246f263e393c6b384c2d98b0dbbcf4dbbeeccad
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65628
    Tested-by: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>