On every Drupal site I do, I add a view that's just tables of all content on the site, grouped by content type. I use Weight on most of these sites, and I always separate the content types with weight into a Views attachment, and add the Weight field so the table rows are draggable.

I've done this at least half a dozen times now without issue. But for some reason, on the site I'm currently working on, some of the tables that should be draggable are not. They show up as expected in the Views preview, but not on the actual page.

Here's a screenshot of the Views preview of my attachment. You can see the drag handles right where they should be. But here's the actual view; the first table gets the drag handles it should, but the rest don't.

There are no Javascript, PHP, or Watchdog errors generated when creating, updating, or viewing this view. This happens regardless of the theme; even if I view the page in the admin theme, where it works in the preview, it's broken on the actual page. I've flushed the cache, run update.php, and run cron multiple times. No use.

I'm at a loss. What could be causing this?

Comments

lanny heidbreder’s picture

I should note that I'm running Weight 7.x-2.1, Views 7.x-3.5, and Drupal 7.15.

davisben’s picture

Status: Active » Postponed (maintainer needs more info)

There could be a bug with grouping tables, although I couldn't reproduce this. Could you check to see if all rows have the draggable class?

lanny heidbreder’s picture

Both the non-draggable and draggable rows do have the "draggable" class. However, the broken tables do NOT have the "tabledrag-processed" class.

davisben’s picture

I'm unable to reproduce this on a clean install. It's possible there is a conflict with another module or theme. Do you know if there are any other theme or preprocess functions on the view?

lanny heidbreder’s picture

Title: Views tables sometimes aren't draggable » Views tables break when jQuery Update is enabled
Status: Postponed (maintainer needs more info) » Active

I finally did the disable-check-reenable dance down my entire Modules list, and found that jQuery Update was causing the problem. When running jQuery Update 7.x-2.2 alongside Weight 7.x-2.1, in my particular scenario, it breaks. I already can't remember why I turned on jQuery Update in the first place, so I'm leaving it off for now, but I'm about to retest the whole site in IE in case it was the reason.

Can you duplicate it now?

davisben’s picture

Project: Weight » jQuery Update
Version: 7.x-2.1 » 7.x-2.2
Component: User interface » Code
Category: support » bug

I am able to reproduce the bug after enabling JQuery Update. I'm moving this issue to that queue in hopes that someone there knows what's going on.

lanny heidbreder’s picture

Title: Views tables break when jQuery Update is enabled » Draggable Views tables (Weight module) break when jQuery Update is enabled
Version: 7.x-2.2 » 7.x-2.3

Updating the title to something a bit more descriptive and bumping the version number. Issue still applies to 2.3.

ConradFlashback’s picture

Sub, same problem.
Weight doesn't work with jquery update.

markhalliwell’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This sounds like a jQuery version/API deprecation issue and can resolved in the 7.x-3.x branch by either:

  1. Choosing a lower jQuery version for an admin theme like Seven
  2. Enabling the jQuery Migrate plugin to handle deprecated APIs/features.
cristiroma’s picture

Another headbanging issue I've encountered is with view using Table formatter. If in the Settings screen of the Table formatter sets the default sorting on a specific column, the draggable views is not working properly:

1. weight is not saved correctly
2. is always sorted the same

You should set the default sorting to None.