Closed (fixed)
Project:
Flag
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2008 at 08:53 UTC
Updated:
19 Sep 2008 at 22:32 UTC
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().
| Comment | File | Size | Author |
|---|---|---|---|
| relats.diff | 4.61 KB | mooffie |
Comments
Comment #1
mooffie commentedI 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.
Comment #2
quicksketchGreat work mooffie. :)
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.