[BUGFIX] Read page ID correctly when drag-dropping content 40/57640/4
authorClaus Due <claus@namelesscoder.net>
Fri, 20 Jul 2018 12:04:55 +0000 (14:04 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 3 Aug 2018 15:15:04 +0000 (17:15 +0200)
commit62681cb0e1872e6f5e88c525547fa0e66d470ab8
tree8eefb5309dfd667eeecba92ba827105fa5c34fa1
parent75e414ba18680db2d79c7397232335fff3a027fa
[BUGFIX] Read page ID correctly when drag-dropping content

Fixes an issue where drag and dropping a content element
would send the page title, not the page ID, as part of the
command map DataHandler receives.

The reason was an indiscriminate lookup in DOM for any
element which had any `data-page` attribute and assuming
that the first found object contained the integer value.

Using the drop target’s parent element instead will resolve
the value from the nearest relative place it can be found.

Effect is that DataHandler command hooks can once again
safely assume that the value of the “move” command is the
target page ID, not an arbitrary title on v9 and ID on v8.

Change-Id: I3b34bd099d50f6ef88fc6df1bbb647acbaa253d2
Releases: master
Resolves: #85603
Reviewed-on: https://review.typo3.org/57640
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Paweł Rogowicz <rogowicz.pawel@gmail.com>
Reviewed-by: Łukasz Uznański <l.uznanski@macopedia.pl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Resources/Private/TypeScript/LayoutModule/DragDrop.ts
typo3/sysext/backend/Resources/Public/JavaScript/LayoutModule/DragDrop.js