Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2009 at 17:52 UTC
Updated:
10 Feb 2010 at 23:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedahh the group by stuff required we remove the automatic base field adding. It appears that the node row style is relying on this field being added automatically.
Comment #2
dagmarHere is a patch.
Comment #3
bwynants commentedthis does not work, the line just above the patch
puts
in $fields_array (for frontpage) and therefor the check if (!is_array($fields_array)) is false and nid is still not added
could it be you meant
because that seems to work....
Comment #4
dagmarYes, you are right. I test it without filters and sorts, and for this reason my previous patch worked fine.
New patch.
Comment #5
bwynants commentedWorks OK
Comment #6
merlinofchaos commentedWait, no, we no longer want the base field to be added automatically. Instead, I think the row style(s) should be fixed to ensure the fields they need are added.
Comment #7
dagmarIt is true. I have created a new patch that modified node row (view / rss) and comment (view / rss).
There is another plugin to modify?
Comment #8
merlinofchaos commentedHm. I think things external to the query object should not directly modify that tables. It should use add_field like normal things (and also, styles can have relationships so that can be used to ensure relationship safety as well).
Comment #9
dagmarHere is the patch using add_field()
Sorry merlinofchaos, I didn't understand this. Can you explain a bit more your idea? Or this is already done by using add_field?
Comment #10
merlinofchaos commentedWhat I mean is that like fields, styles can have the relationship setting. (yched patched this in so I don't remember precisely how it works).
The example is this: Let's say I want to use the node row style on a nodereferenced node. My argument is for the 'base' node, I add a node reference relationship, and then the style uses that relationship. This turned out to be necessary because sometimes it's hard to get the relationships to work in reverse, properly, so always having the actual node displayed be the base node was a difficult problem.
Comment #11
dagmartagging
Comment #12
dagmarOk, finally I found the mentioned issue #327366: Let row plugins follow relationship and here is a new patch that check if relationship es defined.
With patch #9 and using relathionships I get this query
With this patch and using relationships
So, it seems to be working fine.
Comment #13
dawehnerI tested every of this 4 szenarious. Before it didn't worked. Now with the patch it worked fine.
Comment #14
mxmilkiib commentedsubscribe
Comment #15
bwynants commentedI applied #12 and it seems to work just fine. Thanks @dagmar
Comment #16
merlinofchaos commentedI think the only change that needs to be made here is to views_plugin_row::query() which is already doing an add_field() -- I do not believe we need to do this more.
It does seem that a couple of rows (comment and comment_rss) are not relationship safe. That should probably also be fixed.
Comment #17
dagmarHere is the patch
Comment #18
merlinofchaos commentedLet's test out this patch.
This fixes several row styles to be relationship safe, which is important. Those fixes actually should be backported to Views 2.x as those are serious, though very rarely seen bugs.
Comment #19
dagmarYes, works fine. Even this respect the ability of define relationships in rows plugins.
Comment #20
bwynants commentedreverted #12 and applied #18 and things still work. Also some custom views I made.
Comment #21
merlinofchaos commentedNeeds porting to 7.x -- relies on GROUP BY so needs to wait for that.
Comment #22
dawehnerremove tag.
Comment #23
dawehnerHere a patch comes.
For comments and node it worked.
Comment #24
dawehnercommited