• Christian Kuhn's avatar
    [BUGFIX] No MM relations when localizing categories · e5dbc1e7
    Christian Kuhn authored and Benni Mack's avatar Benni Mack committed
    "True" MM relations (those tables that have a "uid_local"
    and "uid_foreign" db column and NO TCA) have a "local" and
    a "foreign" side. For instance with categories, the category
    table is the "local" side, and the referencing table "pages",
    "tt_content", or whatever table, is the foreign side.
    
    Without the patch, MM table rows when localizing the local
    side of an MM relation is buggy, scenario:
    
    A default language tt_content record references
    a default language category. This gives one row in the mm
    table. If now the category is localized, a second entry
    from the localized category to the default language content
    element is added. This is wrong.
    
    The patch fixes this in the DataHandler by setting a
    dedicated override for this "local side localization" scenario,
    so the RelationHandler omits MM processing in this case. A
    functional test is added for non-workspace that exists
    for workspace already to verify a new relation can still
    be added when creating the local side.
    
    Note this is only half of the picture - MM relation should
    still be set and updated when a localized foreign side exists
    for the just localized local side. This does not happen
    currently and leads to broken MM rows even with the patch. This
    scenario however needs a bigger refactoring and further
    increased coverage and will be handled with further patches.
    
    Still, this patch is relatively straight forward, increases
    test coverage for future patches and already solves various
    long standing forge issues.
    
    Change-Id: Ieee8b5a4c101065c03bc7e90c8a4aa36b1bdf6a7
    Resolves: #89659
    Resolves: #89620
    Resolves: #91842
    Resolves: #77902
    Related: #70460
    Related: #62727
    Releases: master
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71094
    
    Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
    Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
    Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
    Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
    Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
    Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    e5dbc1e7