Closed (fixed)
Project:
Views Merge Rows
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Feb 2014 at 22:53 UTC
Updated:
24 Oct 2018 at 07:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gbyteIt appears the problem with pagination output is that Views Merge Rows uses the views_pre_render hook to only change the output of the query that already ran. Views doesn't see the change and still sees the original number of rows.
I don't think there is any way of changing what pagination sees apart of changing this module to using views_pre_build.
Please correct me if I'm wrong.
Anyone looking for similar functionality which changes the query may look into this issue. Though the patch didn't work for my specific case, it may work for you.
Comment #2
gbyteWill be finishing a quick patch for this soon.
Comment #3
gbyteThis patch allows for proper pagination with this module. It uses views_pre_build() to remove the pager (thus removing the LIMIT part of the SQL query).
Though it may slightly slow down queries returning lots of data, it's needed because views_merge_rows only merges the rows in hook_views_pre_render(). There the pager is reset according to the number of merged rows.
It's by no means a perfect solution but it appears to be the only one possible without rewriting the module.
Don't forget to clean the cache.
Comment #4
gbyteComment #5
gbyteFixed a little bug from the previous version of the patch in views_pre_build and changed the warning that warns from using the pager.
Comment #6
neeravbm commentedThere is a bug in the patch. I added second view mode for Data Export and changed the pager limit. This patch still uses the pager limit of the first view mode. The culprit is the line:
$items_per_page = (int)$view->display[$view->tag]->display_options['pager']['options']['items_per_page'];I have changed it to the following:
$items_per_page = (int)$view->display[$view->current_display]->display_options['pager']['options']['items_per_page'];Patch is attached.
Comment #7
neeravbm commentedPatch #6 doesn't work. Here is the updated patch if the current display has different number of items in the pager or has no pager.
Comment #8
scottrigby@neeravbm #7++
Comment #9
nithinkolekar commented@
I am having issue #2502879: support views merge rows iterating though views merged rows with https://www.drupal.org/project/views_rules. From your observations
It seems rules still getting actual rows instead of merged single row with this patch applied.
use case:
task: send notification through sms
setup: build views of phoneno ,Grouping field: Message(not aggregation) exclude from display
sample output:
Comment #10
gbyte@nithinkolekar
This will not change as this module only changes the output of a view that already ran. Views rules however communicates with views through its results. A module is needed that will do what this module does by altering the views sql queries. Big part of that is group concat I believe.
Comment #11
nishant.bhorodia commentedHello @neeravbm
Thank you for the patch. it works perfect.
Just a few things though:
1. I added fetching "items_per_page" from url as well.
2. Total number of results was the same as "items_per_page". so for example, if there are 10 results and items_per_page = 2 then the total_rows = 2 as well. In above example, the total_rows needs to be 10 so fixed that.
Thanks again !!
Comment #12
nishant.bhorodia commentedSorry, first time submitting patch.
Had wrong diff lines on top. made the correction.
Thanks !!
Comment #13
giorgosk#12 does not apply but probably works
placed patch from #12 in module directory and did
git apply -v [patchname].patchbut patch did no apply with following error messagesApplying the patch by hand and clearing cache seems to work
#7 patch applies and seems to work
I also applied #7 patch which applied without me having to do it manually
this also seems to work so I am going to have to go with #7 patch
applied patch to latest DEV version (as its usually the case)
please commit #7
Comment #14
dgagne commentedComment #16
fadi.assaad commentedSame patch for 1.0-rc1
Comment #17
gagandeep_katare commentedI have used #16 patch for 1.0-rc1.
It is working for me if number of result are less then 500,But it is not working if number of result are more then 500 and display White blank screen.