Hi,
I used this module with views 7.x-3.0-rc3, worked perfect.
In the official views 7.x-3.0 release, this module breaks: the content in my views block is empty. Switching to HTML format in my view the view is created.
Using Grouping Field (with Limit) there is the error:
Notice: Undefined index: group in views_plugin_style->render() (regel 251 van /homel/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Notice: Undefined index: rows in views_plugin_style->render() (regel 254 van /home/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Warning: Invalid argument supplied for foreach() in views_plugin_style->render() (regel 254 van /home/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Notice: Undefined index: group in views_plugin_style->render() (regel 251 van /home/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Notice: Undefined index: rows in views_plugin_style->render() (regel 254 van /home/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Warning: Invalid argument supplied for foreach() in views_plugin_style->render() (regel 254 van /home/public_html/drupal-7/sites/all/modules/views/plugins/views_plugin_style.inc).
Comments
Comment #1
mxh commentedsame problem here. i use unformatted list, grouping by rendered date fields. worked withoud problems in rc3.
Notice: Undefined index: group in views_plugin_style->render() (Zeile 251 von .../sites/all/modules/views/plugins/views_plugin_style.inc).
hope this bug will be fixed soon.
Comment #2
Thelrin commentedSame issue. Following.
Comment #3
matrlx commentedI was having the same problem.. just fixed it.
Find this:
Replace it, with this code:
Now it`s working!! :)
At least, for me..
Comment #4
svenryen commentedHi!
Thanks for sharing the fix.
In order to properly limit the items,
I also had to change this:
to
Comment #5
matrlx commentedGreat! I was having difficulty on limit the number of rows!
Thank you!
Comment #6
Anonymous (not verified) commented#3 + #4 worked for me, thanks.
Comment #7
kalmarr commentedI same error, but I can't this code (which line have to change?) the new version....(7.x-3.x-dev) Can You make a path?
THX
KALMI
Comment #8
matrlx commentedkalmarr,
open modules/views_limit_grouping/views_limit_grouping_style_plugin.inc
The code on #3 starts at line 47.
The code on #4 starts at line 78.
Comment #9
redndahead commentedHere is a patch.
Comment #10
redndahead commentedforgot a portion
Comment #11
bschilt commentedThanks! The patch in #10 worked for me.
Comment #12
melon commentedThanks @redndahead, the patch is working great for me as well. Please commit.
Comment #13
shawn dearmond commentedThis is working, but I'm getting a notice repeated a bunch of times:
It's repeating a bunch of times, each with different offsets: 1, 8, 18, 31, 42, 52, 58, 64, and 71.
If this is unrelated to this issue, I'd be happy to open up a new issue.
Comment #14
timmetj commentedI got the same notices.. I changed $classes[$id] to $classes on line #13 in .tpl (for me i dont care about the classes)
The notice is because the $id is not reset properly, it takes the "normal" rowID, and doesn't reset it (i think)
for me I also had to change $grouping_field into $grouping_field[0]['field'] between line #53 and #62. Using latest views 7.x-3.1 and drupal 7.12
Too bad this module isn't updated/invested that much. I normally write my own dirty code in the template to limit rows per group :)
This module could be a good work arround, but needs some rework/update first. As far of now you can use the dev and add the markups mentioned in this thread
Comment #15
poorva commented#14 works for me .
thanks !!
Comment #16
shawn dearmond commentedHere's a re-rolled patch that includes #10 and #14.
Comment #17
theunraveler commentedSorry to have missed this, and thanks to all involved in producing the patch. I'll commit this in the next couple days and release a new version.
Comment #18
kruser commentedI applied the patch in #16, but now the module isn't grouping anything. If I set the Items to display (ex. 3), then it only shows three rows, not a grouping with 3 rows each.
Comment #19
tommy kaneko commentedI had problems getting this to work also. I had a situation where I needed to nest multiple groups, and wanted to limit the number of rows within each successive group. The following solution made it work for me. I took the function render_grouping() from the views_plugin_style.inc that comes with Views and adapted it for my purposes.
I think a little more work needs to be done to the code below to get it "production worthy". For example, at the moment, there is one grouping limit option applied to all nested groups. This should eventually be more granular, so that the user can limit the number of rows within each grouping field.
In any case, my temporary solution, in views_limit_grouping_style_plugin.inc, replace the entire function:
With the following two functions.
EDIT: I corrected a piece in the above code. The code above "forgot" to limit the first grouping field.
Comment #20
xaqroxBuilding on the work Tommy Kaneko did in #16, I added the ability to choose a different limit and offset for each grouping level. It's done enough for my purposes, but it's definitely not done, and I'm hoping someone with more Views plugin experience can help.
I was able to add sections to the settings form to choose values for the limit and offset, and the view preview and a fully rendered view on a page exhibit the desired functionality. However, if you go back to the settings form to edit the values you just entered, they are reset to the defaults. I commented out the implementation of
option_definition(), because I wasn't sure what was the proper way to describe the new options I was adding, which I'm guessing is necessary to get the form to work right.Anyway, my patch including Tommy Kaneko's work and my edits is attached.
Comment #21
sun-fire commented#20 works for me
Comment #22
toddtomlinson commentedTry patch in #20 below. I had the same problem - only displayed 3 items for the first group and no successive groups. #20 worked for me and fixed the problem.
Comment #23
theunraveler commentedI just pushed some work inspired by the patch in #20 to the 7.x-1.x branch. Please note that once you update, you will have to re-save any views that use group limiting, because I had to change the data structure a bit.
Thanks all for your hard work and clever solutions.
Comment #24
hanskuiters commented7.x-1.x-dev works without any problems (so far). Thanks for this nice module.