Currently, there can be multiple draggableviews on the same page. However, this can only be achieved if each of the draggableviews resides as a display in a distinct view. That is to say, creating a single view and adding two panel displays with a style of draggable table will result in the same problem as before (the first draggableview to load will work but the second will break both).

This appears to be because the patch that was added uses the view name to generate the form_id. Changing it to a counter or if there is some way to reference a unique views display should fix the issue.

CommentFileSizeAuthor
#8 draggableviews-382678.patch2.17 KBjon pugh

Comments

elliotw’s picture

After playing around a little I found a solution that works for me without using a counter.

draggableviews_plugin_style_draggabletable.inc

function render() {
  return drupal_get_form('draggableviews_view_draggabletable_form_'. $this->view->vid . '_' . $this->view->current_display, $this);
}

draggableviews.module

// register theme function for all views
$views = views_get_all_views();
foreach ($views AS $view) {
  if (!isset($view->disabled) || $view->disabled === FALSE) {
    foreach (array_keys($view->display) As $id) {
      $array['draggableviews_view_draggabletable_form_'. $view->vid . '_'. $id] = array(
        'template' => 'draggableviews-view-draggabletable-form',
	'preprocess functions' => array(
	  'template_preprocess_draggableviews_view_draggabletable_form',
	),
	'arguments' => array('form' => NULL),
      );
    }
  }
}
sevi’s picture

Ahh, ok. I didn't test it with multiple displays. Many thanks. The next development snapshot will contain this change.

Woggers’s picture

Any ETA on the next snapshot? :)

sevi’s picture

I committed the latest changes 5 minutes ago :)

sevi’s picture

Status: Active » Fixed

Seems to be fixed

Status: Fixed » Closed (fixed)

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

realityloop’s picture

Status: Closed (fixed) » Needs work

This is still not possible if you use a CCK field as the Draggable View sort field, which is the only way to sort another view containing the same nodes.

I hope my explaination makes sense, if not ask me for further information.

The view displays but ordering isn't possible, and I always get status message "The structure was broken. It has been repaired."

jon pugh’s picture

Status: Needs work » Needs review
StatusFileSize
new2.17 KB

Here's a Patch that fixes this problem, this happens even when multiple displays are not shown on the same page.

It sets the form ID/theme function to always include the $view->name and $view->current_display.

Using the VID isn't necessary because view->name is unique.

sevi’s picture

Thanks for the patch; Committed to DRUPAL-6--3 branch.

Greetings,
sevi

sevi’s picture

Status: Needs review » Fixed

Guess this is fixed.

Status: Fixed » Closed (fixed)

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