Hi
when using a contextual filter which is pulled from a relationship (the coordinates are fields of vocabulary, the view lists nodes which are tagged with that vocabulary)
if I add a _lat contextual filter the sql query looks like

WHERE (( (taxonomy_term_data_field_data_taxonomy_vocabulary_6__field_data_field_map.field_map_lat = '28.487474441528' ) )

if I add a proximity filter the sql looks like

WHERE (( (( 6371000 * ACOS( COS( RADIANS(28.487474441528) ) * COS( RADIANS(field_data_field_map.field_map_lat) ) * COS( RADIANS(field_data_field_map.field_map_lon) - RADIANS(-16.316955566406) ) + SIN( RADIANS(28.487474441528) ) * SIN( RADIANS(field_data_field_map.field_map_lat) ) ) )<100) )

So, when using proximity, the relationship doen t seem to be taken into account.

Simone

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geek-merlin’s picture

Issue summary: View changes

I can confirm this. Major PITA.

geek-merlin’s picture

I could workaround this by reversing the direction:
* Proximity filter from base table to relationship does NOT work
* Proximity filter from relationship to base table DOES work

Of course this does not work if you need proximity from relationship to relationship...

geek-merlin’s picture

Status: Active » Needs review
FileSize
1.99 KB

OK now i needed this.
Patch flying in that fixes this nasty bug for me.

geek-merlin’s picture

Title: Proximity views argument relationship » Proximity from views argument ignores relationship