• Christian Kuhn's avatar
    [BUGFIX] Avoid dangling MM relations on workspace publish · e9069128
    Christian Kuhn authored
    When publishing workspace records with connected
    "true" MM relations (uid_local / uid_foreign columns
    and no TCA for that table), DataHandler triggers bugs:
    * It updates uid_local or uid_foreign rows to negative
      uids during the process as intermediate DB state.
    * It leaves "dangling" MM rows of the workspace record
      that has been pushed live.
    The involved code is relatively well encapsulated,
    it only kicks in for this "publish MM relations"
    scenario, the impact of this patch is limited to
    this area.
    The patch rewrites MM workspace publish handling:
    * Avoid parking state in a DataHandler class property
      only used in this scenario.
    * Avoid moving a list of stateful RelationHandler
      instances around and dynamically calling methods
      on those instances.
    * Avoid recursive flex form MM publish handling with
      indirect callback methods that change class state.
    * Obsolete a RelationHandler method used only in
      this scenario.
    * Reduce number of queries.
    The result is a simplified, better encapsulated and well
    commented solution. On a testing side, the patch brings
    a scenario to verify flex form MM relation handling.
    An according styleguide example is pending, too.
    This patch allows us to change auto created MM table
    definitions to unsigned uid_local and uid_foreign columns,
    which is of course the right way to go.
    Change-Id: I0d24f31cbd356f19937c2f8c18d432424e127b97
    Resolves: #95275
    Resolves: #81718
    Releases: master
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71097
    Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
    Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
    Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
    Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>