What I am trying to do is when you view an article, it displays other authors that write in this particular subject. We have gotten it to work, but we only want to display only unique authors. We were able to get it working using this module with RC1 (Get the author name and Uid and do a count on the Uid), but when we upgraded to RC2, it broke and I can't figure out a solution.
Here is the query being run:
SELECT node.nid AS nid,
node_data_field_article_author.field_article_author_uid AS node_data_field_article_author_field_article_author_uid,
node.type AS node_type,
node.vid AS node_vid,
COUNT(users.uid) AS users_uid
FROM node node
INNER JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN content_type_article node_data_field_article_author ON node.vid = node_data_field_article_author.vid
INNER JOIN users users ON node.uid = users.uid
WHERE (node.type in ('article')) AND (term_node.tid = 1)
GROUP BY node_data_field_article_author_field_article_author_uid, nid, node_type, node_vid
ORDER BY users_uid DESC
Comment | File | Size | Author |
---|---|---|---|
#9 | views_grouby_rc1_rc2.diff | 4.6 KB | WorldFallz |
Comments
Comment #1
irakli CreditAttribution: irakli commentedIs this the query from RC2?
Any chance you might be able to post queries from both versions, so that we can compare?
Thank you
Comment #2
mongothemad CreditAttribution: mongothemad commentedHere is from RC1:
SELECT node.nid AS nid,
node_data_field_article_author.field_article_author_uid AS
node_data_field_article_author_field_article_author_uid,
node.type AS node_type,
node.vid AS node_vid,
COUNT(users.uid) AS users_uid
FROM node node
INNER JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN content_type_article node_data_field_article_author ON
node.vid = node_data_field_article_author.vid
INNER JOIN users users ON node.uid = users.uid
WHERE (node.type in ('article')) AND (term_node.tid = 1)
GROUP BY node_data_field_article_author_field_article_author_uid, nid,
node_type, node_vid
ORDER BY users_uid DESC
When we reverted back, it worked just as it did before.
Comment #3
mongothemad CreditAttribution: mongothemad commentedswitched from support to bug report. (Since it works in RC1 and not RC2)
Comment #4
irakli CreditAttribution: irakli commentedAndrew,
the two SQLs you posted are exactly the same. Can you, please, provide SQLs generated when run with RC2 and RC1? That would be tremendous help.
Thank you
Irakli
Comment #5
irakli CreditAttribution: irakli commentedComment #6
rsevero CreditAttribution: rsevero commentedMarking it fixed for lack of info.
Please reopen with extra info if necessary.
Comment #7
WorldFallz CreditAttribution: WorldFallz commentedI can replicate this.
The query I get from RC1 is:
And the query I get from RC2 is:
Notice the extra
node_type, node_vid
on the GROUP BY line of RC2.Comment #8
rsevero CreditAttribution: rsevero commentedYes, I've seen this problem before in Views GroupBy.
I have a suggestion for this kind of issues: drop Views GroupBy and use Views 3 which has grouping functionality embedded. I know it's still alpha but it's in bug squashing mode as far as I can tell and it's really usable.
Let me clarify that I'm not a maintainer for neither Views GroupBy nor Views.
I'm leaving it open in case someone decides to tackle this issue.
Comment #9
WorldFallz CreditAttribution: WorldFallz commentedYes--- views 3 is amazing and completely obviates the need for views_groupby. It's also quite stable and I use it in a number of sites already so it's definitely worth trying.
I'm just not sure how stable it will be using it with all the other views related contribs out there (like views_charts, views_slideshow, etc.).
I took a look at the diff between rc1 and rc2 but this is way into the views api which is still pretty much over my head. It's probably not worth spending too much time on it since views 3 is available-- but i've attached the diff in case someone wants to take a quick look.
Comment #10
rsevero CreditAttribution: rsevero commentedI briefly tested Views Charts with Views 3 and all (few) tests I made worked as expected.
I would be inclined to adapt Views Charts to Views 3 if anybody finds any problem in this area. Please open any relevant issue in Views Charts queue.
Comment #11
zeezhao CreditAttribution: zeezhao commentedFyi - as I came across this thread, I did a quick test on a site close to production with views 3.x and all the latest views* modules + charts*.
I noticed that csv/xls exports were now being truncated to one page only. It may well be that views_bonus is not yet compatible with views 3.x. Thought I'd mention this. In any case, I have to stick with views 2.11 since site is close to go-live now...