I have a draggable table view with files as the base table and a category vocabulary exposed filter.
Everything is working as expected but when I save the view (the workflow was filter by term > change order > save) I get:
Notice: Undefined index: draggableviews_setting_view in draggableviews_contextual_links_view_alter() (line 180 of /home/user/site/dev/sites/all/modules/draggableviews/draggableviews.module).
Notice: Undefined offset: 1 in draggableviews_contextual_links_view_alter() (line 184 of /home/user/site/dev/sites/all/modules/draggableviews/draggableviews.module).
I have only just tried this out and got the error once and am now going to bed so I will have no more information but will investigate further tomorrow.
I am using latest stable drupal and views and latest dev of draggable views.
Comments
Comment #1
Niklas Fiekas commentedYep, I have this on all pages that have a view that is not using DraggableViews.
Comment #2
rooby commentedThe problem actually occurs on any view where there is a 'weight' sort that isn't the draggable views weight sort.
When this module looks for its sort it specifically looks for sorts called 'weight', which is a problem since there are other sorts in views that use the same name (like taxonomy term weight for example).
Plus, in the case that there is another sort called weight before the draggable views one, then the draggable views one is called something like weight_1.
This patch changes the way the module identifies the draggable views weight sort to avoid all these potential problems.
Comment #3
Niklas Fiekas commentedThank you. One of the warnings is no longer occuring, but I still have:
If you need a dumped variable to find the error, or if I can do anything else, please ask.
Comment #4
rooby commentedI can't reproduce that on mine.
It seems strange because it means you have a view with a draggable views weight sort that has the 'Display sort as' option set to a view that doesn't have a display.
If you dump the $view variable just before line 184 and then hit the page where you get that error it should give some insight and I might be able to work out what the problem is.
Also, you probably already have, but make sure you've cleared all your drupal caches and stuff as it is an odd problem.
Comment #5
Niklas Fiekas commentedHere you go.
Comment #6
rooby commentedI think I know what is going on.
It seems you are using one view with a display for a slideshow and a display for sorting the slideshow with draggable views. Is that right?
If so your problem lies in using a single view. For now at least, this module requires that the view to be sorted and the draggable sorting view must be entirely separate views. Confusing I know but for now that is how it is, see #1392304: Allow using a different display of the same view for sorting
So once you have done that, in the weight sort for your slideshow you will be able to select the view you use for your draggable sorting.
In addition to that I have also made this amended patch that will also avoid the error you are seeing in this case (however your sort won't work as expected).
Comment #7
Niklas Fiekas commentedYou're exactly right. Thank you! Now that I am using DraggableViews how it's supposed to be used (+ your patch) I no longer have warnings, and the sorting works always, not just randomly.
Comment #8
rooby commentedExcellent, thanks for testing the patch.
Comment #9
ygerasimov commentedThank you for the great patch! Committed!
I this check is not really needed. So I have removed it.
Comment #10
brightboldI was getting this error using today's dev, but solved it with the patch in #1410460: Breaking changes with commit b9acb58 or 22a0cd5 — undoubtedly this is a short-lived error but I wanted to report it in case anyone else is having this same problem today!
Comment #11
chrisschaub commentedI don't think this patch is in the latest dev from git for 7.2.x, somehow. I see later commits from the 21st, but not this one. The code in #9 is not there -- but maybe you meant you didn't use it?
Comment #12
chrisschaub commentedOk, I think this part is important:
Notice: Undefined index: weight in draggableviews_contextual_links_view_alter() (line 180
Which come about because "weight" is something else or not defined. I think that part of the patch code needs to be committed, the #9 stuff you omitted, so that $order_view_display gets set correctly.
Comment #13
rooby commentedYes, this code has some parts that aren't strictly necessary as mentioned in #9 but also has parts that are necessary.
These parts are necessary.
These parts are not really necessary.
Comment #14
carwin commentedSubscribe
Comment #15
betoscopio@carwin, please don't do that ... http://drupal.org/node/1306444
As cschaub says in #11, seems that the patch is not applied in dev. I'm using 2.x-dev from January 30 and still seeing the same error, but now the line is 192.
I try to apply the patch in #6 but i'm getting this error
I think that the patch should be updated, but i'm not sure how to do that.
Comment #16
rooby commentedYes, part of that patch has already been applied.
I'll reroll a new patch for the extra part that is needed tonight.
Comment #17
carwin commentedStill getting this error, though it does seem to be with less frequency than the last dev version.
From what I can tell it's really a random appearance. Sometimes it appears on nodes, sometimes it appears on views. I can't seem to find a real trigger for the cause.
Comment #18
rooby commentedThanks for reminding me, I forgot to do that new patch.
Here is a new patch with the missing part.
Comment #19
ygerasimov commented@carwin can you please confirm that patch from #18 solves your case?
Comment #20
carwin commented@ygerasimov @rooby
Applied patch in #18 cleanly.
Error persisted.
Cleared cache.
Haven't seen it since. Thanks rooby.
----
edit:
Error returned.
Comment #21
rooby commentedWhat is your error message now?
Same one?
Same line number?
I didn't actually have time to test that patch as I'm using the on e in #6 still, but it should have worked.
I'll test the new one prorerly later.
Comment #22
rooby commentedAlso, are you using latest dev?
Comment #23
carwin commentedYep, latest dev, same error/notice and same line number.
Comment #24
rooby commentedI should also add that the patch in #18 is definitely necessary as it was left out of the patch in #6 when it was committed in #9.
I still have to check out carwin's error message.
Comment #25
ygerasimov commented@roody, I have committed patch #18. I will very appreciate if you can help me with @carwin's problem.
@carwin it would very help if you can guide how exactly to reproduce the error. Could you please enable devel module and apply attached patch. It doesn't fix anything but will dpm() a view that throws error. It will very help if you can trace this view and explain how to create it. Hope in this way we can fix this error. Thank you a lot!
Comment #26
fernly commentedFYI: problem is still there in the 2012-Mar-06 dev release.
Comment #27
ygerasimov commented@lennartvv, Could you please provide step by step instructions how to reproduce the error?
Comment #28
ygerasimov commentedComment #29
ak commentedI got the same error using DraggableViews 7.x-2.x-dev, 2012-Mar-16.
Notice: Undefined offset: 1 in draggableviews_contextual_links_view_alter() (line 182 …
Comment #30
kirkofalltrades commentedSame.
Comment #31
ygerasimov commentedPlease review attached patch. I just have added extra check.
Comment #32
robertom commentedHi ygerasimov, sorry for my bad english...
I have this problem and patch #31 works, but the problem is that $order_view_display is null, so I could use also the attached patch.
I have created 1 view with 4 display of type "content pane" (2 for order and 2 for display item).
This content pane is added to page with "page manager" and variants of type "panels".
I don't know why my $order_view_display is null
Thanks for your hard work
Comment #33
rooby commentedFor the $order_view_display to be empty I would think you would have to have no draggable sort set up for your view.
Maybe an export of your view would help identify your issue.
If you can paste it into a text file and attach it keeps the issue cleaner.
Might be a good idea to add that extra check though to cover bases.
Comment #34
robertom commentedYou are right... now I have set "display sort as" for content pane that list items and notice is gone...
...also without extra check
thanks
edit: draggableviews sort criteria was configured, but I haven't setted the "display sort as" select list... so it was null
now is all ok
Comment #35
robertom commentedThe patch #32 is needed when I go to the page that have incorporated the sortable "content pane"
Comment #36
Shadlington commented#35 resolves this for me
Comment #37
ygerasimov commentedAlright. I am happy to add this additional check. Committed. Thank you a lot.