I'm not sure what I did, but I'm no longer able to sort anything in views using ajax and drag and drop. I do see this in my logs:

Warning: Invalid argument supplied for foreach() in views_plugin_display->uses_exposed() (line 273 of/Applications/MAMP/htdocs/mirc/sites/all/modules/views/plugins/views_plugin_display.inc).

And the referrer link led to this http://localhost/mirc/admin/structure/views/ajax/config-item/resources_b... which output a long list of errors.

thought it might be related to dragable views, disabling did nothing. Any idea on what's cauing the problem?

thanks.

Comments

hazah’s picture

I have no idea how appropriate this quick solution is, but here is what I did, I changed that line to read:

foreach (is_array($this->view->$type) ? $this->view->$type : array() as $id => $handler) {

dawehner’s picture

Project: Views (for Drupal 7) » DraggableViews
Version: 7.x-3.x-dev » 7.x-2.x-dev
Component: User interface » Code

Let's move to draggable views first, because it seems to be rather a bug in that module than in views, because otherwise more people would have seen the problem, but sure i'm guessing at that point.

ygerasimov’s picture

Status: Active » Postponed (maintainer needs more info)

@dotman please advise what version of draggableviews do you use? Also please advise what handler do you use Native of Field API?

Please advise more information about how to reproduce the problem.

bcaimano’s picture

I am experiencing the same problem using 7.x-2.0+2-dev and Native API.

ygerasimov’s picture

@bcaimano please advise step by step instruction how to reproduce the problem.

dreamproduction’s picture

Status: Postponed (maintainer needs more info) » Active

@ygerasimov, in order to reproduce, please add any exposed filter to the ordering view.

ippy’s picture

Version: 7.x-2.x-dev » 7.x-2.0

Hello

First, a thank you to the maintainers for a great module. Much appreciated.

Its not the dev version, but I'm currently reproducing same error message (same uses_exposed function, at line 289 of views_plugin_display.inc) with same location path. Native handler.

Test view setup:

- display page
- title field
- body field
- sort by draggableviews: weight (asc)
- published = yes

- sort page
- nid field (excluded)
-draggableviews: content field
- title field
- sort by draggableviews: weight (asc)
- published = yes

On the sort page I can rearrange things and that is actually accurately reflected in the view preview for that page (though I understand from the documentation that it may not necessarily do so). However, when visiting the display page, the items are returned in a seemingly random order and the same items may be returned at different positions if I switch paging on (ie same item may appear at page 4, 9,27 - or not at all).

Things I noticed (which may well be irrelevant, but I feel are worth mentioning):
- the first time I go to the sort page and "save" I get the confirmation message;
- next time I visit, re-order a couple of things I get the message "Changes made in this table will not be saved until the form is submitted", but when I do "save" I no longer get any confirmation that changes have been saved (is that as expected?);
- when I revisit the sort page the order remains as I had set it;

Respectfully, I don't think the approach hazah suggested in #1 (hacking views_plugin_display.inc directly) is good, as it will be overwritten next time the file is updated (and by then you probably forget you made a change). Though the detail itself may be helpful for understanding the problem ;)

Happy to supply any further detail, help test etc. Just let me know.

janekD7’s picture

Unfortunately I experienced the same issue on Drupal 7.23, View 7.x-3.7, Draggableviews 7.x-2.0

hazah’s picture

To be clear, hacking modules is never the best approach. So I would not suggest that for anything long term.

kostask’s picture

Status: Active » Fixed

I was experiencing the same behaviour with draggbleviews7.x-2.0. Upgrading to the latest dev fixed the problem.

Feel free to re-open if you are still experiencing this problem using the latest dev version.

Status: Fixed » Closed (fixed)

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