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

mgifford’s picture

Yup, I'm getting similar errors:

    *  Notice: Undefined index: draggableviews_delta in draggableviews_handler_native->init()  (line 15 of /home/dm7/sites/all/modules/contrib/draggableviews/implementations/draggableviews_handler_native.inc).
    * Notice: Undefined index: items_per_page in draggableviews_views_pre_execute() (line 258 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.module).
    * Notice: Undefined property: stdClass::$nid in _draggableviews_info() (line 194 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.inc).
    * Notice: Undefined property: stdClass::$nid in _draggableviews_info() (line 194 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.inc).
    * Notice: Undefined index: items_per_page in draggableviews_views_pre_render() (line 341 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.module).
    * Notice: Undefined index: items_per_page in _draggableviews_extend_view_window() (line 601 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.inc).
    * Notice: Undefined index: items_per_page in _draggableviews_quick_check_structure() (line 229 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.inc).
    * Notice: Undefined index: items_per_page in _draggableviews_rebuild_hierarchy() (line 393 of /home/dm7/sites/all/modules/contrib/draggableviews/draggableviews.inc).
    * PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-Slide-0-' for key 1: INSERT INTO {draggableviews_structure} (view_name, nid, delta, args, value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => Slide [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 ) in drupal_write_record() (line 6566 of /home/dm7/includes/common.inc).
ygerasimov’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please provide exact settings you have applied in order to reproduce this bug?

mgifford’s picture

I 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.

davegan’s picture

getting the same error as original post.

pembertona’s picture

same here on D7 - subscribing.

Anonymous’s picture

I was having the same problem after I disabled paging. I don't want paging in my application.

The code at line 252 is:

if ($info['pager']->options['items_per_page'] > 0) {

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

duellj’s picture

Status: Postponed (maintainer needs more info) » Active

The 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.

duellj’s picture

Status: Active » Needs review
StatusFileSize
new3.79 KB

Fixed all notices related to item_per_page.

duellj’s picture

StatusFileSize
new3.82 KB

Here's a new patch that applies cleanly against HEAD

seanberto’s picture

Looks like this is also covered in #1141846: Undefined index errors. Happy to mark that issue as a dup.

mgifford’s picture

That would make sense as there are patches here. Thanks @seanberto!

damd’s picture

As this is the oldest issue which discusses the problem, I'm reopening this (needs review) and closing the others as duplicates.

damd’s picture

A 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.

xandeadx’s picture

subscr

ygerasimov’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

finex’s picture

Hi! I'm using the -dev version from 2011-May-16 and the error is still reproducibile.

yarroha’s picture

Status: Closed (fixed) » Active

Hi, I've got this error when try to using version from git (2011-August-08)

Notice: Undefined index: draggableviews_delta in draggableviews_handler_native->init() (line 14 of /home/yarroha/www/d7/htdocs/sites/all/modules/draggableviews/implementations/draggableviews_handler_native.inc).
knalstaaf’s picture

I 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:

  • Node: Title (ascending)
  • Draggable table (can't remember the exact wording)

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:

    Notice: Undefined index: draggableviews_delta in draggableviews_handler_native->init() (line 14 of /var/www/html/sites/all/modules/draggableviews/implementations/draggableviews_handler_native.inc).
    Notice: Undefined index: draggableviews_delta in draggableviews_handler_native->init() (line 14 of /var/www/html/sites/all/modules/draggableviews/implementations/draggableviews_handler_native.inc).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '13-faq-0-' for key 1: INSERT INTO {draggableviews_structure} (view_name, nid, delta, args, value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => faq [:db_insert_placeholder_1] => 13 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 ) in drupal_write_record() (line 6861 of /var/www/html/includes/common.inc).

(See attachment)

knalstaaf’s picture

StatusFileSize
new277.48 KB

I'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:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/faq/preview/page/ajax
StatusText: error
ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '13-faq-0-' for key 1: INSERT INTO {draggableviews_structure} (view_name, nid, delta, args, value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
(
[:db_insert_placeholder_0] => faq
[:db_insert_placeholder_1] => 13
[:db_insert_placeholder_2] => 0
[:db_insert_placeholder_3] => 
[:db_insert_placeholder_4] => 0
)
in drupal_write_record() (line 6861 of /var/www/html/includes/common.inc).
knalstaaf’s picture

I got it to work in the preview, but I can't save my view. Hitting the Save button results in another Ajax error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/view/faq/preview/page/ajax
StatusText: parsererror
ResponseText: 
this-product Silicone Scar Stick | Reduce the visibility of old and new scars
@import url("http://this-product.com/modules/system/system.base.css?lqh535");
@import url("http://this-product.com/modules/system/system.menus.css?lqh535");
@import url("http://this-product.com/modules/system/system.messages.css?lqh535");
@import url("http://this-product.com/modules/system/system.theme.css?lqh535");
@import url("http://this-product.com/modules/system/system.admin.css?lqh535");
@import url("http://this-product.com/modules/contextual/contextual.css?lqh535");
@import url("http://this-product.com/modules/comment/comment.css?lqh535");
@import url("http://this-product.com/modules/field/theme/field.css?lqh535");
@import url("http://this-product.com/modules/node/node.css?lqh535");
@import url("http://this-product.com/modules/search/search.css?lqh535");
@import url("http://this-product.com/modules/user/user.css?lqh535");
@import url("http://this-product.com/sites/all/modules/views/css/views.css?lqh535");
@import url("http://this-product.com/sites/all/modules/ckeditor/ckeditor.css?lqh535");
@import url("http://this-product.com/sites/all/modules/ctools/css/ctools.css?lqh535");
@import url("http://this-product.com/sites/all/modules/nice_menus/nice_menus.css?lqh535");
@import url("http://this-product.com/sites/all/modules/nice_menus/nice_menus_default.css?lqh535");
@import url("http://this-product.com/sites/all/modules/draggableviews/styles.css?lqh535");
@import url("http://this-product.com/modules/toolbar/toolbar.css?lqh535");
@import url("http://this-product.com/modules/shortcut/shortcut.css?lqh535");
@import url("http://this-product.com/themes/seven/reset.css?lqh535");
@import url("http://this-product.com/themes/seven/style.css?lqh535");
Skip to main content
Home
Hello webstrat
Log out
Administrative toolbarDashboard (View and customize your dashboard.)
Content (Administer content and comments.)
Structure (Administer blocks, content types, menus, etc.)
Appearance (Select and configure your themes.)
People (Manage user accounts, roles, and permissions.)
Modules (Enable or disable modules.)
Configuration (Administer settings.)
Reports (View reports, updates, and errors.)
Help (Reference for usage, configuration, and modules.)
Hide shortcuts      
Add content
Find content
Performance
Blocks
Content types
Views
Edit shortcuts  
You are hereHome » Administration » Structure » Views            Add to Default shortcuts      
Status message
Operating in maintenance mode. Go online.
TitleEdit Title
Frequently asked questions      
ContentFilter criteria
Edit Content: Published
Edit Content: Type
Edit Content translation: Language
Add new
Fields
Edit DraggableViews: Order
Edit Content: Title
Edit Content: Body
Add new
Sort criteria
Edit DraggableViews: Order
Edit Content: Title
Add new
Contextual filters
Add new
Relationships
Add new
012
Can I use this-product to help avoid scars?          
Yes. But if the skin has been ruptured you cannot avoid a scar. You can make it less visible. You can use this-product only on completely healed wounds.          
012
How does it work?          
this-product releases a transparent, thin and discrete silicone film and creates as such a protective barrier for the healing of scars, while maintaining the skin’s moisture balance.          
012
Can I use this-product on all parts of the body?          
You can use the product all over the body and face.          

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.

knalstaaf’s picture

StatusFileSize
new62.51 KB
new123.25 KB

In 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.

knalstaaf’s picture

StatusFileSize
new32.78 KB

Now we're getting the following error on the public part of the website (being logged out):

Warning: Division by zero in draggableviews_views_pre_render() (line 387 of /var/www/html/sites/all/modules/draggableviews/draggableviews.module).

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.

wojtha’s picture

jnettik’s picture

I 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.

istryker’s picture

Status: Active » Fixed

This 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.