I'm using this with Drupal 7 beta 2 and Views 7.x-3.x-dev. When trying to save settings, I get an error message saying:

Notice: Undefined index: order in draggableviews_plugin_style_draggabletable->validate() (line 83 of views/draggableviews_plugin_style_draggabletable.inc).

I did some looking around and it seems $this->view->get_items('sort', $this->display->id); doesn't return the sort order if it is set to the default (ASC). I created a patch that does a check for this index and if not, sets sort to ASC so that index is available for validation.

I hope this helps and thank you for your work with this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cocoloco’s picture

Status: Active » Needs review
cocoloco’s picture

Title: Notice: Undefined index: order (patch available) » Notice: Undefined index: order
Itangalo’s picture

Patch rerolled against latest dev, and also to work against the module root directory.

Strangely, I still had some issues after applying this patch. (They disappeared after resaving the sort criteria – don't know if that's because of the patch or because of the save. Sorry.)

Itangalo’s picture

No, sorry, that was me being silly. The patch should work fine.
If someone else can confirm, I'd say that this issue could be set to "reviewed and tested by the community".

rv0’s picture

had some issues with latest dev (patch didn't apply + even without patch, it gave me WSOD on some pages)

so I applied it manually to the previous dev is was using, and this seems to work fine.

stred’s picture

same for me: the patch didn't apply but the code fixed this issue.

smk-ka’s picture

FileSize
1.14 KB

Slightly simplified patch, without explicitly setting the value of 'order'.

carl.brown’s picture

I can confirm that the code in #7 gets rid of the notice on my install: D7.4, Views 7.x-3.0-rc1, DraggableViews 7.x-1.x-dev - however, I didn't try the patch file itself due to previous commenter's problems.
Oddly, I didn't get this notice on the first view I created with just one page display-type, but when I used exactly the same settings for a page display in another view which already had and entity content display type (from the EVA module), that's when the problems started. I'll have another play around at some point and update you if I find anything. Thanks for the patch!

steinmb’s picture

The patch #7 applied cleanly. But I still get a list of warnings when saving a new sort order.

Notice: Undefined index: value0_316 in draggableviews_view_draggabletable_form_submit() (line 443 of /drupal/sites/all/modules/draggableviews/draggableviews.module)
.......

Dunno if these warning are related to this issue or not.

skilip’s picture

Status: Needs review » Reviewed & tested by the community

Patch attached in #7 fixed the undefined index notification. This no-brainer should be committed IMHO.

@steinmb: AFAIK that's a separate issue.

steinmb’s picture

OK, then RTBC

ygerasimov’s picture

Status: Reviewed & tested by the community » Fixed

Committed! thank you very much.

Status: Fixed » Closed (fixed)

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