Tabledrag initialized even when no result and "Save" is displayed as well

Created on 12 July 2016, over 8 years ago
Updated 23 December 2023, 11 months ago

When there are no results Tabledrag still initialized. It just checks if the weight selector is there:

  if ($weight_selector) {
    // Add the tabledrag attributes.
    foreach ($variables['rows'] as $key => $row) {
      $variables['row_classes'][$key][] = 'draggable';
    }
    $table_id = 'weight-table-' . $variables['id'];
    $variables['attributes_array']['id'] = $table_id;

    drupal_add_tabledrag($table_id, 'order', 'sibling', 'weight-selector');
  }

I'm going to find way how to fix it and will provide a patch as soon as possible.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡¦Ukraine ozin πŸ‡ΊπŸ‡¦Lviv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States argiepiano

    Hmm... this fix actually alters the behavior of other module's views forms. For example, Views Bulk Operation displays the views form even if there are no results. After the patch, the VBO views form is not shown.

    While this may seem harmless (after all, you don't need a VBO form if there are no results), I don't think an individual module should make the decision to hide all views forms.

Production build 0.71.5 2024