In the current -dev the bbox filter is only available on nodes. I am building views based on search_api indexes and would like to use the bbox argument.

Attached patch allows me to do that.

CommentFileSizeAuthor
bbox_on_all_views.patch603 bytesbatje

Comments

elaman’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community
robertwb’s picture

Category: Feature request » Bug report

I'm a +1 on this patch. It is very necessary because any module that creates it's own entity type is unable to use the BBOX portion of this views plugin.

I have tested with my custom entity and this BBOX Contextual Filter becomes available.

Thanks @Elaman -- I changed this to a Bug Report because I think it provides half-broken coverage for non-node Entities.

robertwb’s picture

A follow-up to this. I *think* the docs state that using this BBOX filter should have an URL in the form:
http://website.com/?q=geojson_viewname/bbox=-78.839,37.722,-78.208,38.277

However, this fails on my install, because the query handler seems to forget to trim the "bbox=" off the beginning of the argument, resulting in a join clause in my query like so:
(field_data_geofield.geofield_lon >= 'bbox=-78.839')

So, to work properly requires an URL of the form:
http://website.com/?q=geojson_viewname/-78.839,37.722,-78.208,38.277

I do not know if this is peculiar to this patch, I can not believe that it is but before I posted a ticket for needing updated docs I thought I'd mention here. it could be that I added the contextual filter in some strange/incorrect way?

If this is in fact a bug that has crept in, the simple fix, of course, would be to check and trim the "bbox=".

pol’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks !

  • Pol committed 48ed638 on 7.x-1.x authored by batje
    Issue #2060197 by batje: Fixed enable bbox filter on all views.
    
pol’s picture

@robertwb: could you open another issue and provide a live example where we can see the problem (or a feature) so I can debug and fix it ?

Thanks

Status: Fixed » Closed (fixed)

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

mpgeek’s picture