I have used draggableviews on a few sites now without problems but using the betas.
I started on a new site in the last few days and all of a sudden I am having trouble. Every time I edit the style settings it does not seem to keep its settings.
It seems to save the settings but the form seems go back to defaults every time I edit the settings.
Drupal 6.15
DraggableViews 6.x-3.3
Views 6.x-2.8
Content 6.x-2.6
After some digging I changed the following in draggableviews_plugin_style_draggabletable.inc in function options_form()
From:
// Check for input.
if (count($input) > 0) {
// Define the input data as the current data.
$current = $form_state['input']['style_options'];
}
else {
// Define the already stored data as the current data.
$current = $this->options;
}
To:
// Check for input.
if (count($input) > 0) {
// Define the input data as the current data.
$current = $form_state['input']['style_options'];
}
if (!$current) {
// Define the already stored data as the current data.
$current = $this->options;
}
And this seems to fix the problem but I don’t know why this is happening or if this is a workaround rather than a fix.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | draggableviews-677886-2.patch | 854 bytes | sevi |
| #11 | draggableviews-677886-1.patch | 763 bytes | sevi |
| #11 | draggableviews-677886-the-fatal-change.patch | 666 bytes | sevi |
| #9 | draggableviews.patch | 1.04 KB | seanr |
Comments
Comment #1
bleen commented+1
I'm having this issue as well
Comment #2
bleen commented+1 for the fix described in the original post - it seems to work fine
Comment #3
sevi commentedMmm.. something must have changed in views.
With views 6--2-7 everything works fine.
With views 6--2-8 I see the problems you described.
You've to refresh the html UI-page after updating views before you can see the effect. Thus the fatal change must be somewhere in the javascript-settings.
I couldn't find the significant change yet. At the moment I don't have time to dig deeper. Maybe someone can find the significant change in views.
This would help me understanding why things don't work now.
Thanks,
Greetings,
sevi
Comment #4
seanrSame issue here. Seems like a bug in views. Should we submit a separate issue there or change this one to views instead?
Comment #5
sevi commentedI'm not yet sure whether this is a bug of views. I'll probably find some time on Wednesday to get things straight.
Comment #6
NaX commented@sevi
When I first discovered the problem it looked like
$form_state['input']['style_options']was not being set. I hope that helps.I don’t know of any API change on the Views 2.x branch. Maybe this is a bug in Views.
Comment #7
seanrI went ahead and posted a separate issue in the views queue to try to find out what they changed:
#682610: Some module-defined view style settings don't save
Comment #8
dawehnerYou missed to define a lot of variables in option_definition. I think you need this to store all this values.
Comment #9
seanrAfters some debugging, it looks like the problem is occurring down at line 145 where $current is defined. After commenting out everything in that block of code except for $current = $this->options;, everything works perfectly. See attached.
The only trouble is that the order doesn't save when I go to the page, reorder the items, and click save order. I don't think that's related to this patch, though (I always have a hellish time getting these views to work right).
Comment #10
seanrFigured out my other problem - view works perfectly now with just the patch in #9. BTW, the change in the initial post wouldn't work because $current does get populated, but with only one of the field values instead of all of them. I'm honestly not sure why that whole if statement was ever needed in the first place.
Comment #11
sevi commentedGot it.
The first patch shows the fatal change of views. IT IS NOT A BUG OF VIEWS.
The second and third patch applies to draggableviews.module and views/draggableviews_plugin_style_draggabletable.inc. They make things working again :)
Greetings,
sevi
Comment #12
sevi commentedE.g. when you add a new node type at the draggableviews-settings (the "Add type" button) the options-form gets updated without saving the values. Here we need to use the input values instead of the saved values -> Your patch would fail in this situation.
Comment #13
sevi commentedComment #14
NaX commented@sevi
I have tested and confirm that you patch’s from #11 worked for me.
Comment #15
sevi commentedGreat, Thanks.
Committed patches
to DRUPAL-6--3 branch.
Changed title for findability.
Greetings,
sevi