Review main Merged

57970[BUGFIX] Decouple pasting from drag & drop handling

Andreas Kienast CR +2 V +2 Normal +75 −43 updated 08/22/18, 07:55

Commit message

The "Paste" action now does not depend on the `DragDrop` anymore.
Previously, the `onDrop` event callback was called manually which is
wrong in that case, as the callback does far more calculations than
necessary when doing a simple paste action.

In the same run, the DragDrop module has been simplified, the module now
doesn't know anything about pasting content elements anymore.

Review

  • Code review CR +2
    • Mathias Brodala +2
    • Markus Klein +1
    • Manuel Selbach +1
  • Verified V +2
    • Mathias Brodala +2
    • Manuel Selbach +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 1517

  1. Andreas Kienast uploaded patch set 1 08/20/18, 17:25

  2. TYPO3com voted on patch set 1 V +1 08/20/18, 17:33 Completed build in 08m 19s on Mon, 20 Aug, 07:33 PM Test Summary: 34905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26835

  3. Manuel Selbach voted on patch set 1 V +1 CR +1 08/20/18, 17:36

  4. Andreas Kienast uploaded patch set 2 08/20/18, 18:37

  5. TYPO3com voted on patch set 2 V +1 08/20/18, 18:47 Completed build in 09m 58s on Mon, 20 Aug, 08:47 PM Test Summary: 34905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-26837

  6. Markus Klein commented on patch set 1 08/20/18, 19:47

    DragDrop.ts:220

    two times the same line?
  7. Markus Klein commented on patch set 2 08/20/18, 19:50

    DragDrop.ts:249

    why do we need this now? was it missing before?
  8. Andreas Kienast commented on patch set 2 08/20/18, 19:50

    DragDrop.ts:220 Reply

    Already fixed in Patch Set 2
  9. Andreas Kienast commented on patch set 2 08/20/18, 19:51

    DragDrop.ts:249 Reply

    Well, copyAction was completely unused before and reloading the page module after a simple move action doesn't make sense to me.
  10. Mathias Brodala voted on patch set 2 V +1 CR +1 08/21/18, 07:46

  11. Markus Klein voted on patch set 2 CR +1 08/21/18, 10:54

  12. Manuel Selbach voted on patch set 2 V +1 CR +1 08/21/18, 16:06

  13. Mathias Brodala voted on patch set 2 V +2 CR +2 08/22/18, 07:08

  14. Mathias Brodala merged patch set 3 08/22/18, 07:08

  15. Claus Due commented on patch set 3 08/22/18, 07:24

    DragDrop.ts:219

    Correct me if I'm wrong, but this means that: * The posted data array no longer posts a clipboard command * The post action now only contains a target PID, no traces of colPos or language UID * This does not trigger the PHP code that would move the record. If this worked while testing I have to assume it was tested only by taking content from for example page UID 2 in colPos 0 in language 0 and then copy/cut/paste'ing that element onto for example page UID 1 and observing that the pid changed. If I'm right about the things that changed then I'd say that's a significant regression - sorry.
  16. Andreas Kienast commented on patch set 3 08/22/18, 07:33

    DragDrop.ts:219 Reply

    * That's correct, the clipboard command is removed here, as the paste logic is a hack since the beginning, which is decoupled now. * The CMD map does not need to know pid, colPos or sys_language_uid, that's what the DATA map is for * I don't get what you mean with PHP code - the AjaxDatHandler is still called with the data map and cmd map.
  17. Claus Due commented on patch set 3 08/22/18, 07:55

    DragDrop.ts:219 Reply

    I tested and it seems to work, so no cause for alarm. I was worried about this introducing inability to correctly copy by CTRL-dragging, or drag-dropping to other languages in the page module. By PHP code I meant internals of DataHandler which receives the parameters from the CB array. So that still receives it when you use buttons, and doesn't seem to need it when you CTRL-drag. The one thing that doesn't work correctly is a minor thing. If you drag to another language the viewport doesn't refresh and the language icon of the record doesn't change.