Follow-up for #638032: Comment author/uid argument.

quoting myself:

The comment author's uid is stored in the comments table, so it would be natural being able to filter for "comment author uid" without adding a relation.

At the moment there is only a "comment author name" argument (because a copy of the author's username is also stored in the comments table), but no "comment author uid" argument. I think this is weird and should be changed.

Comments

donquixote’s picture

Using a value that is already in the table we are using should not require a relation, thus saving the cost of an unnecessary JOIN. Especially, if it is something as basic as the comment author's uid.

There are more arguments in the linked issue, but I think all relevant things have been said in this one quote.

donquixote’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

-- d.o. turbulence made me re-post the same thing again. --

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

There is no reason why this feature request shouldn't be part of d6 part of views.

donquixote’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

@dereine,
sorry, I was not aware how we do this in views issue queue. Some maintainers want that issues are fixed in D7 before they go to D6. I'm totally fine with D6, and in fact this would be my use case for the time being.

iamjon’s picture

Category: feature » task

Marking this as an unassigned task. If anyone wants to roll up their sleeves and write a patch that would be awesome.

dawehner’s picture

@donquixote
If you really have such problems here you should have taken your time and implement it :)
Once you are into the views api this issue isn't that hard.

dawehner’s picture

In fact relationships + filter for the join field could be not automatically joined. This wouldn't be that easy from my perspective but perhaps doable.

dawehner’s picture

Title: Make comment uid available without a relationship » Make comment uid,nid available without a relationship
Version: 6.x-3.x-dev » 7.x-3.x-dev
Assigned: Unassigned » merlinofchaos
Status: Active » Needs review
StatusFileSize
new876 bytes

Here is a patch which does both for 7.x-3.x

assign for earl to decide whether it's good to not force the relationship again for certain fields.

In theory it would be possible to not add a join as long just the base field is used on the other table.

merlinofchaos’s picture

Status: Needs review » Needs work

For both of these, the title will need to change slightly to be more explicit; what's there now is aimed at the relationship. Possibly that should be moved to the relationship and a more generic one (and possibly help too) used for the argument/filter. And may as well make it a field too once we do that.

Once those are done, there's no problem with this.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB

Here is a new version.

dawehner’s picture

Status: Needs review » Fixed

Commited to 7.x-3.x and 6.x-3.x

donquixote’s picture

Thanks!

> Once you are into the views api this issue isn't that hard.

Yeah, the patches look easy. But honestly, it would have taken me longer to figure that out. Next time, maybe.

Status: Fixed » Closed (fixed)

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