Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2007 at 04:55 UTC
Updated:
13 Mar 2010 at 00:52 UTC
Each business (node) has a taxonomy neighborhood which is multi select. I have them summarized by neighborhood in the view, but when I click a neighborhood it lists those nodes with multiple neighborhoods multiple times.
Arguments
Taxonomy: Term ID set to summary sorted. Am I missing something in the option field here?
Node: Feed Selector display all.
This may all be caused by, or made worse by, my use of multiple locations for each node. If I display field location:street in the list, I get multiple multiples. But both multi select taxonomy and multiple locations are relatively important.
Anyone have suggestion to deal with this problem?
Matthew
Comments
Comment #1
leobaby commentedCan anyone at least tell me if this is normal behavior?
Comment #2
merlinofchaos commentedAdd the "Node: Distinct" filter to your view. THat usually fixes problems of this nature.
Comment #3
leobaby commentedNode:Distinct definitely breaks the Summary. Is this an either/or situation?
If I choose a filter Node:Distinct
and an argument Taxonomy: Term ID set to Summary, Sort Ascending
then the result is a summary that lists a term name for each node.
Is it somehow possible to create a summary with one view that overrides the broken summary of another? or Is it possible to create a summary view that points to the distinct list of another view?
Comment #4
merlinofchaos commented1.6-beta2 or alter should fix the summary + distinct error.
Comment #5
leobaby commentedI am still not able to get this work. Anyone know if it's just me?
Comment #6
leobaby commentedI am still unable to get this to work. Can anyone tell me if they have success with multi-select taxonomy and node:distinct?
Many thanks
Comment #7
karens commentedI'm reopening this issue since this is the issue referred to in the commit at http://cvs.drupal.org/viewcvs/drupal/contributions/modules/views/views_q... and I think that commit has broken things. In that commit, anything in the orderby is getting added to the groupby which creates completely mixed up results. This has broken several of my modules that use summary views.
As an example, the following view should create a simple table of node titles summarized by taxonomy term and sorted by sticky and last updated dates. Instead of grouping by taxonomy term, it is grouped by taxonomy term and also sticky and also last updated. Adding last updated to the groupby effectively creates a list of individual items instead of grouping by taxonomy terms. Interestingly, even though the view does NOT ask for node distinct, node distinct has been added to the query too.
I think part of the problem is the following bit in the add_orderby() function, which adds anything in the orderby to the groupby:
That seems an odd thing to do and I'm not sure when it would work right.
The other part of my problem with summary views now is that I am getting a DISTINCT when I don't want it, but I couldn't figure out what was adding the DISTINCT clause to the query since the view itself was not asking for it.
The view:
The query it creates:
Comment #8
karens commentedForgot to change the version and altering the title a bit.
I did some more digging into the original commit to see if there was any way to preserve the original intent but not break summary views. The commit message says:
This is the issue referred to by that commit, but there is no patch by vhmauery here and I couldn't find one anywhere else. The Postgres fixes in general have been to make sure that fields in orderby and sortby are also in the select list, which is handled already in the sortby function, so I'm pretty sure that the bit of code added by this commit is not needed to fix the postgres problem and I think it would be safe to just rollback the commit. At any rate, that gets summary views working again for me.
I don't know that this will fix the original issue, but the committed fix didn't seem to do that anyway.
As I dig into this more, I probably should have opened a new issue for the problem with the commit and also reopened this issue which still needs a solution. Sorry for any confusion...
Comment #9
designerbrent commentedsubscribing as this is now effecting me.
Comment #10
merlinofchaos commentedleobaby: This may all be caused by, or made worse by, my use of multiple locations for each node. If I display field location:street in the list, I get multiple multiples. But both multi select taxonomy and multiple locations are relatively important.
There's a CCK setting you need to ensure that multiple fields don't cause Views to bring up multiple records; I think it's 'group multiple fields' or something along those lines. I need to play with this so I can answer that question better.
With multi-select taxonomy, though, I'm not able to duplicate your problem at all, so I don't have further advice.
KarenS: The postgres patch you're looking for is http://drupal.org/node/121144 -- I guess I misnumbered it on the checkin. Bad me. IN any case, the problem with the view you posted is that the sort criteria you put really aren't valid. Apparently in PGSQL if you have a group by, you can't sort by items that are NOT part of the group by (since that sort will have no meaning). In the view you posted, you're stuck with summary, sort ascending or summary, sort descending. But summary, sorted as view isn't going to work very well at all, unfortunately.
If there's something still wrong with 121144 let's take it there.
Comment #11
designerbrent commentedThis still seems to be a problem even after updating to views-5.x-1.6-beta5.tar.gz
Where is this setting? In CCK or in Views. If it is in views, I can't seem to figure out where it is. It seems to be duplicating on the Taxonomy terms for me now.
Comment #12
merlinofchaos commented"CCK Setting".
Thus: Not Views.
Comment #13
yched commentedActually it's a setting defined by CCK but exposed in the Views UI : When adding a CCK field to your Views "Fields", you have a dropdown allowing you to chose 'Group multiple values' (default) / 'Do not group multiple values'.
Comment #14
csc4 commentedI've just put up a new Drupal 5 with current downloads of views, views bonus, taxonomy etc (all my taxonomies are free tagging if it makes any difference)
The directory / taxonomy_directory options is horribly broken - I'm getting 50 links all to the same letter all with a count of 1 with duplicate nodes all over the place!!
Comment #15
dustyd commentedSame problem here. Searching for a solution.
Comment #16
karens commentedTo fix the taxonomy directory to work with the latest changes, open the view and edit it and change 'Summary, sorted as view' to 'Summary, sorted ascending' in the 'Arguments' area.
I just committed a fix to the default view in the bonus pack to do the same thing, but you'll have to make that change in any version of the view you already have in your system.
Comment #17
designerbrent commentedThanks Karen. That seemed to do the trick for me!
Comment #18
(not verified) commentedComment #19
patrickharris commentedSummary views is not working for me either. Changing 'Summary, sorted as view' (which used to work fine) to 'Summary, sorted ascending' in the 'Arguments' area didn't work as a fix for me.
Comment #20
joachim commentedWhat's the fix for this?
I have a fairly simple view that shows blog posts with:
- a taxonomy argument
- a vocab filter to get only terms from the right vocab in the summary
- sorted by node creation
and the problem is as described above:
- with the distinct filter, terms repeated, one node only per term
- without the distinct filter, nodes are repeated
Comment #21
joachim commentedHacking about with the query shows that the problem in my case is the node.nid in:
GROUP BY node.nid, term_data.name, term_data_weight,
This is put in by the Node: Distinct filter.
I've no idea why the distinct filter needs to group on nids... removing this line from views_node.inc doesn't cause any side-effects (yet!!)
#$query->add_groupby('node.nid');
Comment #22
esmerel commentedno real work is going into views 1 at this point - I don't see the changes getting worked on/committed.