Grouping does not work - using grid style, Row style: Fields
| Project: | Views |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
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 ?
| Attachment | Size |
|---|---|
| views_no_grouping.jpg | 11.72 KB |
| views_grouping_title_sorted.jpg | 15.05 KB |
| views_grouping_term_sorted.jpg | 15.01 KB |

#1
Sorry for the last two jpgs
Term: Black is missing on top (I actually applied wrong crop)
#2
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.
#3
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.
#4
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.
#5
@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: Fieldsstill 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
<?php//plugin/views_plugin_style.inc line 159
foreach ($records as $label => $row) {
$rows[] = $this->row_plugin->render($row);
$this->view->row_index++;
}
?>
rendergets called with the right row (node) but returns a different one renderedChecked further in the theme.inc
<?php//theme.inc theme() line 686
$output = $render_function($template_file, $variables);
?>
and before
$render_functiongets called$variablescontains mixed stuff(content != raw) ??!!!!!!
<?php$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
#6
Sorry forgot to change status
#7
i'm also having the same issue with HTML list, unformatted and grid. the table style however is grouping things perfectly.
#8
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.
#9
@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
#10
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.
#11
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 :)
#12
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! :)
#13
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.
#14
Same issue here. Rolling back to 2.6 fixed the problem :(
#15
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 :(
#16
Try this patch, I think this fixes it for styles not named table.
#17
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
#18
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
#19
I also just wanted to note that I applied this patch to 2.7 and everything with row style: fields worked great.
#20
is it safe to say reviewed and tested by the community ??
#21
Applied to all branches. Thanks for testing!