I'm using Draggable Views for the first time and was having trouble getting the drag handles to show up. I finally realized I hadn't added a node type to the Draggable Table settings, although it's possible I made some other changes to the settings at the same time.
When I saved those settings, the handle appeared, but I also received the following error:
Notice: Undefined index: items_per_page in draggableviews_views_pre_execute() (line 258 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews.module).
Notice: Undefined index: items_per_page in draggableviews_views_pre_render() (line 341 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews.module).
Notice: Undefined index: items_per_page in _draggableviews_extend_view_window() (line 601 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews.inc).
Notice: Undefined index: items_per_page in _draggableviews_quick_check_structure() (line 229 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews.inc).
Notice: Undefined index: items_per_page in draggableviews_views_pre_render() (line 398 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews.module).
Notice: Undefined variable: form_elements in include() (line 13 of C:\Web\BrightBold\sites\all\modules\draggableviews\draggableviews-view-draggabletable-form.tpl.php).
I changed the pager settings from "10 per page" to "Display all items" but the error persists. The final "undefined variable" line seems to only appear for anonymous users (who don't have admin/reorder rights for draggable views).
Comments
Comment #1
mgiffordYup, I'm getting similar errors:
Comment #3
ygerasimov commentedCould you please provide exact settings you have applied in order to reproduce this bug?
Comment #4
mgiffordI think it was just with enabling it. But I'll have to get back to you when I've got time to try this again.
Comment #5
davegan commentedgetting the same error as original post.
Comment #6
pembertona commentedsame here on D7 - subscribing.
Comment #7
Anonymous (not verified) commentedI was having the same problem after I disabled paging. I don't want paging in my application.
The code at line 252 is:
So I went back to my view, added a pager and set it to page every 1000 records, since I'll never have more than 100. The error went away.
Thanks,
Doug Gough
Comment #8
duellj commentedThe problem is when you change create a view to display all items. The new pager plugin options doesn't set the items_per_page option when you are displaying all items (since all pages pager is a separate pager plugin).
There might be a bigger problem here, because a lot of the code assumes items_per_page option exists, so a lot of the pager code might need to be upgraded to the way views 3.x handles pagers.
Comment #9
duellj commentedFixed all notices related to item_per_page.
Comment #10
duellj commentedHere's a new patch that applies cleanly against HEAD
Comment #11
seanberto commentedLooks like this is also covered in #1141846: Undefined index errors. Happy to mark that issue as a dup.
Comment #12
mgiffordThat would make sense as there are patches here. Thanks @seanberto!
Comment #13
damd commentedAs this is the oldest issue which discusses the problem, I'm reopening this (needs review) and closing the others as duplicates.
Comment #14
damd commentedA workaround for those who don't wish to patch the module themselves is to set the pager to display a very large amount of items.
Comment #15
xandeadx commentedsubscr
Comment #16
ygerasimov commentedCommitted. Thanks!
Comment #18
finex commentedHi! I'm using the -dev version from 2011-May-16 and the error is still reproducibile.
Comment #19
yarroha commentedHi, I've got this error when try to using version from git (2011-August-08)
Comment #20
knalstaaf commentedI encountered this error after adding a Sort criterium (Node: Title - ascending) on top of the already added Draggable table-criterium, thus having two sort criteria:
The critical point of this behaviour is that I can't open that very view anymore. When clicking the view in the Views overview (admin/structure/views/), I get this error:
(See attachment)
Comment #21
knalstaaf commentedI'm getting an Ajax error as well when checking both the "Show input fields"-options in the settings of Draggable Table (Format) and submitting the settings:
Comment #22
knalstaaf commentedI got it to work in the preview, but I can't save my view. Hitting the Save button results in another Ajax error:
However, if I close the admin overlay and navigate to the view again, everything's still there, ànd if I hit the Save button now it causes no trouble.
Comment #23
knalstaaf commentedIn case it could help anyone, attached you'll find the configuration that works for me. It seems DV it has some issues with the Ajax environment of Drupal though.
Comment #24
knalstaaf commentedNow we're getting the following error on the public part of the website (being logged out):
Since we're dealing with a rather tight time schedule, we've decided to wait to use the Draggable Views module until there's a stable Drupal 7 version.
Comment #25
wojtha commented#1199468: Notice: Undefined index: items_per_page in _draggableviews_click_sort() marked as duplicate of this issue.
Comment #26
jnettikI can confirm the two errors that knalstaaf has gotten in #21 and #22. I got the first error initially and then after using the configurations that were shown in #23 when I tried to save I got the second error.
Comment #27
istryker commentedThis is an issue for 7.x-1.x-dev, which is unsupported now. There is no problem like this in 7.x-2.x-dev. Pager currently doesn't work. See #1551230: Add pager support for DraggableViews tables
items_per_page argument is removed in the latest 7.x-2.x-dev. #1901170: Never save items_per_page argument