I'm not seeing drag-drop handles in the manage display forms Field UI.

Timplunkett did a quick debug in IRC: Uncaught DrupalBehaviorError: attach ; fieldUIDisplayOverview: Cannot set property 'onDrop' of undefined

Seems to be caused by #2382557: Change JS settings into a separate asset type

Marking critical because now you can't hide fields, which defeats the purpose of display modes, which is at the heart of why you'd want to use Drupal as a CMS.

Suggested commit message:

Issue #2388215 by freblasty, tim.plunkett: Drag and drop is broken.
Files: 
CommentFileSizeAuthor
#10 2388215-tabledrag-10.patch1.51 KBtim.plunkett
#3 2388215-tabledrag-2.patch771 bytestim.plunkett
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2388215-tabledrag-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

yoroy’s picture

On a probably unrelated note: timplunket and me both wondered what the 'Parent' column is all about.

yoroy’s picture

Title:Drag and drop is broken in field UIDrag and drop is broken
Component:field system» javascript

Actually, no drag/drop anywhere (menus, blocks page)

tim.plunkett’s picture

Status:Active» Needs review
Issue tags:+JavaScript
StatusFileSize
new771 bytes
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2388215-tabledrag-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

This broke all of tabledrag. I checked menu UI and block UI as well.

It was just the result of a sloppy change in the other issue.

I manually tested, everything works now.

yoroy’s picture

Status:Needs review» Reviewed & tested by the community

Checked in simplytest.me and yes, that puts things right again.

jibran’s picture

tim.plunkett’s picture

Issue summary:View changes

This one was tested and RTBC'd.

Committers, please also credit @freblasty

jibran’s picture

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs tests
+++ b/core/includes/common.inc
@@ -2159,7 +2159,7 @@ function drupal_attach_tabledrag(&$element, array $options) {
-  $element['#attached']['drupalSettings'][$options['table_id']][$group][$tabledrag_id] = array(
+  $element['#attached']['drupalSettings']['tableDrag'][$options['table_id']][$group][$tabledrag_id] = array(

This is a php code change. Can we add tests for this?

webchick’s picture

Title:Drag and drop is brokenTests for Drag and drop
Priority:Critical» Major
Status:Needs work» Postponed

According to Tim, this wouldn't give us something we could check in the markup, only in the JS settings. So presumably this needs Behat or similar to actually test meaningfully.

So for now, let's kill the regression. Committed and pushed #3 to 8.0.x. Thanks!

Leaving open/postponed for the tests for when it's possible. Ideally, this would go into some queue somewhere for "front-end stuff we really need to test when we get front-end testing."

  • webchick committed bab6233 on 8.0.x
    Issue #2388215 by freblasty, tim.plunkett: Drag and drop is broken.
    
tim.plunkett’s picture

StatusFileSize
new1.51 KB

I agree with #8, but in case someone *really* wants to just test the PHP part of this, and assert random keys in a giant array, we could.

jibran’s picture

Why can't we just create a simple method just like Drupal\system\Tests\Theme\TableTest::testThemeTableStickyHeaders()? Or a test same as PathElementFormTest for core/lib/Drupal/Core/Render/Element/Table.php. In which we create table elements in a form (TableFormTest::buildForm()) and then do some asserts on $form = \Drupal::get('form_builder')->getForm(\Drupal\system\Tests\Element\TableFormTest());

The last submitted patch, 3: 2388215-tabledrag-2.patch, failed testing.

Real_gambi’s picture

jibran

This change help me, thanks!!!