Hi,

I am using views3rc1 (drupal7.8), and have a simple gallery set up, whereby the teaser content of a gallery node is output. The view is served as an entity view, using search_api and entity.

On the views page the items per page selector works fine, however the All option fails to display any nodes/content.

Also, on a side note, when I expose the pager's Items per page selector it does not function correctly in preview.

I don't think I've set anything up wrong, does anyone have any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Could you provide an export of the view and a screenshot? It's kind of hard to follow what you exactly did.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Update status.

ZuluWarrior’s picture

FileSize
251.95 KB
144.46 KB
3.25 KB

Here's some info, please find attached an export of the view, and a couple of screenshots, one proving the 'number of items to show' exposed works when set, the other showing the empty output when selecting 'All'.

I notice that in order for the number of results to match the number displayed in the drop down when the page first loads, you have to set the 'Items per page' of the pager to the same number as the first in your drop down list. Any other vlaue in 'items per page' causes incorrect results.

ZuluWarrior’s picture

Status: Postponed (maintainer needs more info) » Active
dawehner’s picture

Oh wait this could be a problem of search_api. Did you tryed it with a normal view page, for example nodes?

By manually trying it out, it works as expected.

ZuluWarrior’s picture

Project: Views (for Drupal 7) » Search API
Version: 7.x-3.0-rc1 » 7.x-1.0-beta10
Component: page displays » Views integration

Thanks dereine,

you my well be right there, so I've (attempted) to move the issue to search_api

drunken monkey’s picture

Version: 7.x-1.0-beta10 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
850 bytes

Didn't know there was such an option, but the attached patch should fix this oversight.
Please try it out!

shiff2kl’s picture

I had this issue as well. I applied the patch and it now works as expected. Thanks.

sun-fire’s picture

The patch from #7 works for me.

dawehner’s picture

Status: Needs review » Needs work
+++ b/contrib/search_api_views/includes/query.incundefined
@@ -216,8 +216,10 @@ class SearchApiViewsQuery extends views_plugin_query {
+      if ($this->limit) {

What about for checking either limit of offset?

adel-by’s picture

patch at #7 works for me.
Thanks

shiff2kl’s picture

Status: Needs work » Needs review

Patch #7 works for me. Can this get included into the module?

phenaproxima’s picture

The patch in #7 worked for me too. Thank you, drunken monkey!

r2integrated’s picture

Confirming #7 works. Cheers!

Anonymous’s picture

Changes in #7 work fine to fix the "View all" issue with search api (solr) based views.

There is still a problem when using the view with a contextual filter (/taxonomy/term/%). In this case, as soon as the filter "Items per page" is exposed, I always get an empty output (even when selecting a specific number of items per page). I took a look at Solr logs, and the query is not even performed.

Has anyone experienced anything similar?

Thanks!

Anonymous’s picture

And, as usual, I've found the answer after posting here!

I had wrongly set the "user input required" in the exposed filter options.

BTW It would be nice to see this patch committed. Thanks!

drunken monkey’s picture

Status: Needs review » Fixed
FileSize
1.14 KB

Patch #7 works for me. Can this get included into the module?

BTW It would be nice to see this patch committed. Thanks!

If you've successfully tested a patch (especially if you aren't the first one), then please set the status to "reviewed & tested by the community". Otherwise, I'm bound to overlook some already tested patches.
Anyways, thanks for bumping, and thanks to you all for testing! Funny, that an 18-months-old patch still applies perfectly …

However, right before committing I stumbled upon another view of mine which I have set to show no (0) items. With the patch applied, it now too showed all items, which is of course not desirable. I had therefore to come up with a new patch, which you can find attached. The problem is that Views is incosistent in the value it uses to specify “All items” – see #2004580: $query->limit should be NULL if "All" option is selected. In the attached patch, I just work around the fact, hoping a possible solution for the Views issue won't break this fix.
I also incorporated the critique in #10, which was of course also true: there might still be an offset, even if all items are shown.

So, please test the attached patch to see if it, too, fixes the bug for you. Then I can finally get it committed.

drunken monkey’s picture

Status: Fixed » Needs review
Anonymous’s picture

Upgraded to Search API 7.x-1.6. "View All" shows no results.

Reapplied patch in #17. "View All" works fine. All other searches I have defined in my website work as well.

drunken monkey’s picture

Status: Needs review » Fixed

Excellent, thanks for testing again!
Committed.

Status: Fixed » Closed (fixed)

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