We have several relationship handlers, and they all, in their query() method, duplicate code from View's original query().

There are several problems here: readability, bugs (Views had its code fixed once since we shipped ours), maintainability, and loss of flexibility (we hardcode the table names; I'll explain why this is a problem --even though we have only one table, flag_content-- if I'm asked to).

The patch solves this:

All we do in our handlers is twick 'extra'. So that's the only thing we should do, and then we can delegate to parent::query().

CommentFileSizeAuthor
relats.diff4.61 KBmooffie

Comments

mooffie’s picture

Status: Needs review » Fixed

I commited this.

Remember to clear Views' cache.

(Sorry for not waiting for an "ok": having so many patches lying around makes me waste my time managing patches instead of programming ;-)

Comments:

1. I removed `'field' => 'uid'` because it serves only one purpose: documentation; and as such it's ambiguous: it's not clear whether it's the field of this table or of the referred table.

2. I use 'relationship field' instead of 'real field' because this seems to be the "official" way to do this with relationships.

quicksketch’s picture

Great work mooffie. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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