Search code examples
drupaldrupal-7

Drupal update to 7.51 - I can't drag and drop tables anymore


Just updated my Drupal to latest version of 7.51 and I don't seem to be able to drag and drop tables now. Anyone know how to fix or what the cause is?


Solution

  • I found that the file 'misc/tabledrag.js' has been changed and that's the cause:-

    `// Add the mousedown action for the handle.
      --277handle.mousedown(function (event) {
      ++279handle.bind('mousedown touchstart pointerdown', function (event) {
      ++280if (event.originalEvent.type == "touchstart") {
      ++281event = event.originalEvent.touches[0];
      ++282}`
    

    Nothing wrong with that change but the mouseCoords on line 588 is looking for 'clientX' and 'clientY' they don't exist on the the pointerdown event. I found that changing:-

    x: event.clientX + document.body.scrollLeft - document.body.clientLeft,
    y: event.clientY + document.body.scrollTop  - document.body.clientTop
    

    to

    x: event.originalEvent.clientX + document.body.scrollLeft - document.body.clientLeft,
    y: event.originalEvent.clientY + document.body.scrollTop  - document.body.clientTop
    

    fixed it, not sure if it's right but I'll be patching my sites to this until it's fixed in the next release!

    EDIT

    A patch has now been created here: https://www.drupal.org/node/2821441