If I export a draggable view to code, the settings aren't exported, see code
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'draggabletable';
$handler->display->display_options['style_options']['columns'] = array(
'field_button_icon_fid' => 'field_button_icon_fid',
'title' => 'title',
'field_button_linkto_nid' => 'field_button_linkto_nid',
'field_button_order_value' => 'field_button_order_value',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'field_button_icon_fid' => array(
'align' => '',
'separator' => '',
),
'title' => array(
'sortable' => 0,
'align' => '',
'separator' => '',
),
'field_button_linkto_nid' => array(
'align' => '',
'separator' => '',
),
'field_button_order_value' => array(
'sortable' => 0,
'align' => '',
'separator' => '',
),
);
$handler->display->display_options['style_options']['override'] = 1;
$handler->display->display_options['style_options']['sticky'] = 0;
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['path'] = 'buttons-order';
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | draggableviews-873436-d7.patch | 9.92 KB | recrit |
| #3 | 873436-export-3.patch | 10.07 KB | dixon_ |
| #2 | draggableviews-873436.patch | 835 bytes | attiks |
Comments
Comment #1
attiks commentedI fixed this by adding the following line to views/draggableviews_plugin_style_draggabletable.inc
Comment #2
attiks commentedPatch agains 6.x-3.x
Comment #3
dixon_Actually there is more settings missing. Views 3 more strict and does only export options defined in
options_definition(). So here is a patch that should cover all settings for the native handler. Being more strict about the definition of options also saves us some logic in the form building as Views pre populates the options!But we need to figure out a way to get settings added via
hook_draggableviews_style_plugin_form_alter()exportable. Maybe we can add a hook inoption_definition()that'll let other modules add their options... But hopefully there is a cleaner way around this. I'll look into it.But first, here is a patch that should work for the native handler, needs work with other handlers as mentioned above. It is backwards compatible with Views 2.x also!
Comment #4
dixon_Ok. I've tested my patch from #3 on several sites for a while, and it seems to work fine. I've committed this to
DRUPAL-6--3.But we still need to figure out how to support handlers implementing
hook_draggableviews_style_plugin_form_alter().Comment #5
recrit commentedsaw this in 7.x also. The attached patch is #3 applied to 7.x-1.x-dev. Please commit to 7.x also.
Comment #6
sjs commentedHi.
That patch (#5) fixed the export problem for me in DraggableViews 7.x-1.x-dev (2011-Feb-25).
Thanks.
Comment #7
ginc commentedComment #8
ygerasimov commentedcommitted. thanks