If number of items per page is exposed in Search API view, cache key does not take this value into account, and therefore the view display the same (cached) number of items.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alex Bukach’s picture

Assigned: Alex Bukach » Unassigned
Status: Active » Needs review
FileSize
815 bytes
drunken monkey’s picture

Thanks for reporting this, and providing a patch!
I think it's a bit too narrow, though. As I see, there is also an option to expose the offset? Instead of using the exposed data directly, we should maybe just use all the pager data of the view, instead of just the current page.

The attached patch should solve this and hopefully cover all cases – I think. Please test!

Status: Needs review » Needs work

The last submitted patch, 2: 2334727-2--items_per_page_cache_key.patch, failed testing.

Alex Bukach’s picture

Status: Needs work » Needs review
FileSize
880 bytes

Another iteration.

Alex Bukach’s picture

drunken monkey, with this little amendment the patch works fine as well. Thanks!

drunken monkey’s picture

Status: Needs review » Fixed

Ah, oops! I remember I spotted this error, too, but it seems I didn't recreate the patch file after fixing that … Thanks for posting a corrected version, and good to hear this now works, too.
Committed.
Thanks again!

Status: Fixed » Closed (fixed)

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

drunken monkey’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

I think this needs to be ported to D8.

drunken monkey’s picture

Issue tags: +Novice
adooo’s picture

The patch is gone from 7.x-1.x

drunken monkey’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Patch (to be ported) » Closed (fixed)

OK, thanks a lot for verifying this!
Then we can close this again after all.