Drag-and-drop does not work for some fields: e.g. title, post date, etc. (though works for other - body, image, links). I am able to initiate the drag but I am not able to drop it to another region.

This is the js error. Handling fields through "Show row weights" works fine.

tabledrag.js?v=8.3.0-beta1:957 Uncaught TypeError: Cannot read property 'relationship' of undefined
at Drupal.tableDrag.updateField (tabledrag.js?v=8.3.0-beta1:957)
at Drupal.tableDrag.updateFields (tabledrag.js?v=8.3.0-beta1:936)
at Drupal.tableDrag.dropRow (tabledrag.js?v=8.3.0-beta1:776)
at HTMLDocument. (tabledrag.js?v=8.3.0-beta1:243)
at HTMLDocument.dispatch (jquery.min.js?v=2.2.3:3)
at HTMLDocument.r.handle (jquery.min.js?v=2.2.3:3)

CommentFileSizeAuthor
#9 2855327-ds-9.patch456 bytestim.plunkett
#6 2855327-6.patch475 bytesswentel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paupale created an issue. See original summary.

mrtndlmt’s picture

Same issue over here. Searching for a solution.

aspilicious’s picture

Priority: Normal » Critical

There is a problem with fields that are set in the "disabled" region. You can't drag them into the main regions. (the region doesn't gets changed while dragging)
We use the core field UI javascript but core doesn't have fields in the disabled region by default.

I think we need to fix this in core but we could fix it by overwriting the field UI javascript like we did before.

swentel’s picture

Looking at this in the train back to belgium.

So, all core fields also have the 'parent' column filled with 'content' and 'hidden' when a ds layout is chosen, but our ds fields don't, is this something that we have to take over as well. I'm a bit confused here why parent exactly is used anyway, will check what core is doing.

swentel’s picture

Ok, so this parent thing doesn't look like a problem, digging further

swentel’s picture

Status: Active » Needs review
FileSize
475 bytes

So, it's a class thing :) (relying on classes isn't the safest thing, but oh well)

We should probably try to write a js test for this, maybe commit this first and then see. (or even a ridiculous hard coded xpath check on the output to make sure we never delete this class)

Note: maybe we can even remove the 'ds-field-region' class, I don't really think we use it anymore right ?

aspilicious’s picture

yes, we can change the classname and commit. We don't have custom JS anymore.

cmwelding’s picture

Facing same problem with the latest developmental release. Cannot drag a field from hidden region to active regions.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
456 bytes

Made the change of #7, manually tested, all is well.

  • swentel committed 184e8ff on 8.x-3.x authored by tim.plunkett
    Issue #2855327 by swentel, tim.plunkett: Drag-and-drop does not work for...
swentel’s picture

Status: Reviewed & tested by the community » Fixed

committed and pushed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Nylsoo’s picture

The error still occurred for me. I had to apply the following patch to fix it for me:
https://www.drupal.org/files/issues/2866211-field_group-tabledrag-issue....

aspilicious’s picture

Status: Closed (fixed) » Active

I'll test this tonight

aspilicious’s picture

Status: Active » Fixed

Fieldgroup has a new branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.