Kephson / paste_reference

Paste reference instead of copy for content elements in TYPO3
MIT License
14 stars 18 forks source link

[BUG] Change Datahandler Call when Moving Elements with Drag&Drop #6

Closed achimfritz closed 1 year ago

achimfritz commented 1 year ago

Summary / Description

do not mix data and cmd in PasteReferenceDragAndDrop JS

the PasteReferenceDragAndDrop JS uses a mix of data and cmd when moving elements like

data = [
    'tt_content' => [
        'colPos' => 10,
        'sys_language_uid' => 0
    ]
];
cmd = [
    'tt_content' => [
        1 => ['move' => 139]
    ]
];

this leads to multiple Workspace Bugs (https://forge.typo3.org/issues/92849) core has removed this mix https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/c1be5540b20421fdfa295a1323b663f3189a41d7

mixing cmd and data has also dropped from EXT:container 2.0, and this leads to https://github.com/b13/container/issues/297

the EXT:paste_reference datahandler call in the JS should change to:

data = null;
cmd = [
  'tt_content' => [
      1 => [
          'move' => [
              'action' => 'paste',
              'target' => 139,
              'update' => [
                  'colPos' => 10,
                  'sys_language_uid' => 0
              ]
          ]
      ]
  ]
];

i will provide an PR