Relationships defined using wrong base field

drewish - September 22, 2009 - 19:43
Project:Views
Version:7.x-3.x-dev
Component:Views Data
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

The relationships that views defines for the core modules use 'field' for the base field but this doesn't match up with what views_handler_relationship defines:

* - base: The new base table this relationship will be adding. This does not
*   have to be a declared base table, but if there are no tables that
*   utilize this base table, it won't be very effective.
* - base field: The field to use in the relationship; if left out this iwll be
*   assumed to be the primary field.

I'm guessing that since it's joining on the base table's primary field this error was masked. I noticed it after copy pasting the code into another module that used a non-primary field.

The patch also fixes some spelling errors I noticed and my editor removed some trailing whitespace.

AttachmentSize
views_base_field.patch5.9 KB

#1

drewish - September 22, 2009 - 19:48
Version:6.x-2.x-dev» 6.x-3.x-dev

here's a patch for 3.x. no real changes besides accounting for a change in an adjacent line.

AttachmentSize
views_base_field_3x.patch 5.99 KB

#2

merlinofchaos - November 2, 2009 - 23:25
Version:6.x-3.x-dev» 7.x-3.x-dev
Status:needs review» patch (to be ported)

Ok, this is commited to 6.x both 2.x and 3.x branches. Doesn't apply to the 7.x--3.x branch -- needs a port.

#3

dereine - November 3, 2009 - 00:53
Status:patch (to be ported)» needs review

Fast port

AttachmentSize
views_base_field_3x.patch 5.94 KB

#4

matt2000 - November 3, 2009 - 01:14
Status:needs review» reviewed & tested by the community

looks good, applies clean, doesn't break anything AFAICT.

#5

dereine - November 5, 2009 - 00:37

Arg Earl commited this patch together with another patch. I will try to commit it tomorrow

#6

dereine - November 9, 2009 - 22:50
Status:reviewed & tested by the community» fixed

Today it tomorrow :)
Thanks for the review!

Fixed.

#7

System Message - November 23, 2009 - 23:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.