Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have location CCK and I can't filter this field in Views.
Are they compatible?
I've looked at #391160: CCK/Views: location_instance fix but it applies to D6.
also I've seen #1064666: Location CCK not saving for entities other than nodes but not sure if it's related
Comments
Comment #1
ankur CreditAttribution: ankur commentedYou can filter the locations as node locations. CCK locations are saved to the same table and are queried the same way. The ability to create a location relationship to the CCK location field and then filter on fields using the relationship doesn't exist in 7.x-3.x. Both work, but the drawback with not having the CCK location limitation is that if you have more than one location CCK field, but only want to filter on one of them, you will need the relationship.
Comment #2
mstrelan CreditAttribution: mstrelan commentedHow is this "fixed"?
It is absolutely essential for my project to only show one location field, as I have physical address and billing address. It makes absolutely no sense to show billing address on the map.
Comment #3
Nchase CreditAttribution: Nchase commentedHaving nodes with more than one location field creates duplicate entries in views, as much as location fields are in the node.
I haven't seen any relationship in views that let me select the field.
Comment #4
glynster CreditAttribution: glynster commentedI am currently dealing with the same issue. However I have a User Field for the location and a view created in the hope that I can expose the city and country filters. However I am not getting any results due to not being able to set a relationship.
Has anyone figured out a way?
Comment #5
ydahiSame issue as glynster.
Add CCK location field for user account.
Create a view that lists users.
Add location fields in view (i.e Location: City) - field is empty.
However, same process for nodes does render the field properly.
Can use the User:Location field in the view, however this is limited by the formatters provided (i.e not granular)
It seems that this issue was tackled back here: http://drupal.org/node/1064666
Query
Any help would be greatly appreciated.
Comment #6
ydahiI should note that using the User Locations module in place of the CCK field does work.
The reason to use the CCK field instead of the User Locations module:
The field can be neatly tucked into a field group, where as the user location settings display either above or below the rest of the user account fields.
If there was a way to allow for the location fields to be included within a field group, that would be lovely.
Comment #7
glynster CreditAttribution: glynster commentedThanks for the further explanations on this. All the same problems I have encountered and you are right in that if you used the user location it works well. The only thing we are missing here is a relationship. Once the location module allows a relationship we should be good. Alas not luck as of yet.
Comment #8
jessia CreditAttribution: jessia commentedYes, I've got the same comments and same issues as ydahi—I can get User Locations to show on a map and get the granular control (city, state, country, etc. as individual fields). I can get the CCK Location for the User to show as an address (or a map, or both), but I can't find a way to pull just the city and country from the address, or to pull the lat/long fields, which I need to place all the user locations on the map.
I am in the process of migrating my site from D6 to D7 and it seemed like the CCK Location was the way to go, but it seems like there are some missing pieces still. I'm guessing the thing to do is to stick with User Locations for now?
Comment #9
ydahiI've started building an alternative solution with Address Field with a great deal of success.
There is a very helpful tutorial found here.
Comment #10
joegl CreditAttribution: joegl commentedI am having the same issue. I can't get the Distance / Proximity filter to work with a CCK Location field on a node.
Comment #11
joegl CreditAttribution: joegl commentedI am still having this issue. How would I use a Distance / Proximity filter on a CCK field location?