I have looked at #596668: Grouping field not "grouping" nodes and #361298: Grouping field problem when "link to node" enabled but the outputs seems to be different
and I am using 2.x dev from Oct 29 2009 (reason being some translation fixes being committed to dev)

here is how to reproduce from a clean install of drupal 6.14

- allow story to categorize using vocabulary "color"
- "color" vocabulary contains "black" and "blue"
- create stories in this order
story1ColorBlack, story2ColorBlue, story3ColorBlack

- creating a minimal view so we can test grouping
- table style (no grouping yet),
- use fields title,body,term (accept all defaults look at first attachement for preview of view)

- modify style of table group by term
(results in on the corresponding screenshot, not all nodes get displayed)

- if we change the default order the display will be different
- change order by term
(results in on the corresponding screenshot, still not all nodes get displayed)

seems that the query is done right since views knows that there are two black nodes and one blue but they don't get displayed correctly

I have looked at #502348: How group display by mutliple fields? and apparently that patch has already been applied to the latest dev version of views which I am using

I have eclipse and debugger and running but I don't know how I can debug this, any pointers ?? Or how can I help ?

Comments

giorgosk’s picture

Sorry for the last two jpgs
Term: Black is missing on top (I actually applied wrong crop)

RoboPhred’s picture

I am having the same issue. In my case, I am grouping a list of nodes by the domain they come from (via Domain Access). This was working fine on 6.x-2.x, but I updated to dev in order to have a functional "has new content" filter.

There should be 2 different items in my resulting view, one per domain. Both domains show up, but the single item under both is the same item from the first domain.

tomsm’s picture

I have just submitted an issue that describes the same problem with the 6.x-3.x-dev version. See also:
http://drupal.org/node/620486

PS. Sorry for the duplicate.

merlinofchaos’s picture

Status: Active » Fixed
StatusFileSize
new2.05 KB

Ok, thank you for the detailred reproduction instructions. I was able to find the cause of this and fixed it. For reference, this is the patch, but it's already applied in CVS.

giorgosk’s picture

StatusFileSize
new10.03 KB

@merlinofchaos thanks for the fast fix
the grouping does indeed work better with views 2.7 which includes the patch above

BUT,

grouping of grid style, Row style: Fields still does not work correctly
(using Row style:node does not allow grouping)

see attached image (still working with the same example above)
I tried Alignment: Horizontal and Vertical but both give same result

I checked with the debugger and the grouping is done right but

//plugin/views_plugin_style.inc line 159
        foreach ($records as $label => $row) {
          $rows[] = $this->row_plugin->render($row);
          $this->view->row_index++;
        }

render gets called with the right row (node) but returns a different one rendered

Checked further in the theme.inc

//theme.inc theme() line 686
    $output = $render_function($template_file, $variables);

and before $render_function gets called $variables contains mixed stuff
(content != raw) ??!!!!!!

$variables['fields']
title	stdClass	
	content	story2colorBlue	
	raw	Story3ColorBlack	
	inline	false	
	inline_html	div	
	handler	views_handler_field_node	
	element_type	span	
	class	title	
	label	Title	
body	stdClass	
	content	<p>story2ColorBlue</p>\n	
	raw	<p>Story3ColorBlack</p>	
	inline	false	
	inline_html	div	
	handler	views_handler_field_markup	
	element_type	div	
	class	body	
	label	Body	
name	stdClass	
	content	Blue	
	raw	Black	
	inline	false	
	inline_html	div	
	handler	views_handler_field_taxonomy	
	element_type	span	
	class	name	
	label	Term	


but I am quite at a loss to debug further, but hope this helps

giorgosk’s picture

Title: Grouping does not work » Grouping does not work - using grid style, Row style: Fields
Status: Fixed » Active

Sorry forgot to change status

dyke it’s picture

i'm also having the same issue with HTML list, unformatted and grid. the table style however is grouping things perfectly.

mariagwyn’s picture

StatusFileSize
new16.04 KB

I am having the same issues. "Grouping field" was working fine. I don't even recall upgrading, but now, it is not working. I reinstalled 2.x-dev, no good; tried 2.7, also no good. I have tried html, unformatted, table, grid...none of them group at all.

I have attached my view.

giorgosk’s picture

@mariagwyn
if you are indeed using 2.7 after upgrade there seems to be lots of issues with sorting
#622602: 2.6 to 2.7: Queries being created without ORDER BY and #624042: Sorting of data appears not to be working after update

mariagwyn’s picture

It appears the problem has nothing to do with Views. It is the devel-Theme-Developer which is mucking up the output of all sorts of things. I turned it off and it appears that grouping in both 2.7 and 2.x-dev work just fine.

dyke it’s picture

i'm still having the same problem with styles unformatted, html list and grid. i've tried grouping based on various different fields with no success (except in table style which works fine)

i'm using the latest dev. i also tried switching my theme to garland which doesn't work, and i do not have devel-theme-developer installed.

thank you very kindly :)

dyke it’s picture

i updated to the latest dev and it didn't appear to be working at first, but then i changed "distinct" to "no" and it worked. grouping is now working for me on all view styles. yay views magic! :)

dyke it’s picture

i guess i spoke too soon. my view is a related content block that is displayed on node pages. when it displays in default drupal pages (blog, poll, book etc.) it groups everything fine regardless of the view style. however, when it displays on a content type created with cck, the grouping works only with the table style - every other style does not group correctly.

EDIT: and now grouping doesn't appear to be working in any view regardless of content type or settings.

vlooivlerke’s picture

Same issue here. Rolling back to 2.6 fixed the problem :(

Pasi’s picture

And also the same issue ("has new content" filter didn't work) and the same fix (2.6).

But now distinct (view og_ghp_ron with VBO) doesn't work :(

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new2.93 KB

Try this patch, I think this fixes it for styles not named table.

giorgosk’s picture

applied patch on 6.x-2.7 version and tested with

HTML list - row style: fields
Grid - row style: fields
Unformatted - row style: fields
Table - row style: fields

and grouping seems to be working correctly
nothing else breaks - should be good to be committed

dyke it’s picture

Same here. I applied the patch and everything is working perfectly!! Thank you so much!!!

Used it on 6x-2.7 and tested on:

HTML list - row style: fields
Grid - row style: fields
Unformatted - row style: fields
Table - row style: fields

chromix’s picture

I also just wanted to note that I applied this patch to 2.7 and everything with row style: fields worked great.

giorgosk’s picture

Status: Needs review » Reviewed & tested by the community

is it safe to say reviewed and tested by the community ??

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Applied to all branches. Thanks for testing!

c-c-m’s picture

Hello,

I find extremely difficult to apply a patch. Is there any plan to make a new release that solves this bug in the near future? I am using 2.7 version and I am having the same issue.

Thanks

giorgosk’s picture

@c-c-m
comment #21 from merlin means that this patch was applied in all the branches and thus should be available at the latest dev build dated Dec 1st

c-c-m’s picture

Thank you, GiorgosK

But latest stable version is 6.2.7 dates from 02 Nov, and thus the patch has not been applied. The only way to solve this problem is by installing dev version, but I guess that means that it's not stable and I don't know what kind of problems can I have if I install it on my live site. If I am to use only stable versions... waiting is the only option I have (at least that I am aware of), that's why I was asking about the date of the next stable release.

Regards

EDIT: today December 3rd was released a new version (6.2.8) which has solved the error.

techgirlgeek’s picture

Installed 6.2.8 yesterday that said it finally fixes the GROUP BY issues. However now I can't get any style to group, not even HTML list, which I know I could before.

Running the same query directly in mysql with the GROUP BY put in it works fine.

Update: Went into the fields, and removed the "Display as a Link" checkbox from the "Excluded" group by field.

merlinofchaos’s picture

Overloaded terms. It fixes grouping issues, not GROUP BY issues.

This is a different thing. I'm not sure what GROUP BY stuff you are referring to, but it's for another issue.

Status: Fixed » Closed (fixed)

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

rjbrown99’s picture

This works for me. I thought I would point out that the patch in #16 has not been applied to 6.x-3.0-alpha1. I am on that version and had to manually apply it. Just hoping to save someone a bit of troubleshooting time.

eriktoyra’s picture

Thanks! You just saved me from a couple of hours of banging my head against the wall. With the devel-Theme-Developer enabled the Views grouping stops working. Grouping works fine for me in 2.8. This information should be put into in the Views documentation.

dawehner’s picture

Component: Code » Documentation
Category: bug » task
Status: Closed (fixed) » Active

Ok than change tag.

O_o: do you want to make this? This would be cool

dawehner’s picture

Component: Documentation » Code
Category: task » bug
Status: Active » Closed (fixed)

update.
Thx for creating a new issue http://drupal.org/node/708882

dready2011’s picture

@mariagwyn #10

Thanks, that remark finally solved my issues. I had a view that grouped fine on my local machine, but wouldnt work on my staging server. I spent HOURS to figure out why, checking all settings, modules, etc. But it turned out that I had Devels Theme Info activated on staging and not local, and that destroyed the grouping!!! Could have searched on for days, I never imagined something like that to be the cause...