multiple displays in the same view breaks draggableviews
brian42 - February 24, 2009 - 19:29
| Project: | DraggableViews |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.

#1
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),
);
}
}
}
#2
Ahh, ok. I didn't test it with multiple displays. Many thanks. The next development snapshot will contain this change.
#3
Any ETA on the next snapshot? :)
#4
I committed the latest changes 5 minutes ago :)
#5
Seems to be fixed
#6
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
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."
#8
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.
#9
Thanks for the patch; Committed to DRUPAL-6--3 branch.
Greetings,
sevi
#10
Guess this is fixed.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.