Similar to #2174515: SQLSTATE[42S22]: Column not found: 1054 Unknown column error when using location data via Relationship, bounding seems broken when processing the argument against data coming in over a relationship. I was testing this against latest dev with patches at comments 14 and 15 on #1839554: BBox argument handler fixes, but found some of the changes were breaking bounding over a relationship. I noticed that at 17425ec the original commit of the patch at comment 14 was reverted. I've come up with an alternative that implements some of the original changes from the reverted patch, and allows bounding to come in over a relationship.
Comment | File | Size | Author |
---|---|---|---|
#3 | views_geojson--bounding-relationship--2202523-3.patch | 4.46 KB | mpgeek |
#1 | views_geojson--bounding-relationship--2202523-1.patch | 3.93 KB | mpgeek |
Comments
Comment #1
mpgeek CreditAttribution: mpgeek commentedHere is the patch. I've tested this with the geocluster stack and loaded bounding over a simple relationship (
user->profile2
) and over a complex/two-level relationship (user->profile2->field_collection_item
). The main points of interest here are (1) figuring out the alias to the relationship then using the alias in thewhere
clauses, and (2) the use of${lat|lon}_field_obj->real_field
when computing the field names. I'm not sure i understand whyfield
vs.real_field
works, but generating GeoJSON feeds with related data now works.Comment #2
mpgeek CreditAttribution: mpgeek commentedComment #3
mpgeek CreditAttribution: mpgeek commentedThe patch at #1 breaks the "bounding when location data does NOT come in over a relationship" use case. This patch checks for a relationship on the lat/lon source and adds the tables either over the relationship or directly from the base table (as you would expect).
Comment #4
mariacha1 CreditAttribution: mariacha1 commentedThis patch loads an empty set of coordinates if you have relationships that are unrelated to the geolocation fields. In my case, I was needed to pull in a group user, but the fact that I had declared relationships meant that this evaluated to true:
So no geolocation relationship table is being added at all.
Also, the if statement to add lat and lon tables used to be:
But now it's
(That adds the lat field twice.)
Comment #5
PolDid this is still working with dev version ?
Thanks
Comment #6
mpgeek CreditAttribution: mpgeek commentedI believe so. I used it against 7.x-1.x (cc2bc0b) for a production build here: https://github.com/mpgeek/Vista-Map/blob/master/vista_map.make. That SHA isn't that old.
Comment #7
Pol