Closed (works as designed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2011 at 22:52 UTC
Updated:
22 May 2013 at 22:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
helior commentedI attached a screenshot of the sorting options for segments of the addressfield. This is implemented in Views, not directly in Address Field; so you shouldn't have to use tokens as a work-around.

Comment #2
elly commentedI have this problem as well - the issue isn't with the "sort criteria" option in the view - that works fine. The issue is when creating a table view, and enabling click sorting on the table view, click sorting on the addressfield column doesn't work properly. It won't sort by the actual contents of the addressfield column.
Comment #3
doublejosh commentedThought I could get around it by creating a "Global: Custom text" field using the string value AddressField location [tokens], but unfortunately custom text fields are not sortable.
Comment #4
doublejosh commentedHere's a screenshot of the incorrect sorting of this type of field. Assume it's sorting by the first value (in my case "organization").
Comment #5
elly commentedYep, mine is doing the same as #4 - I can't figure out what it's sorting on though, as my address doesn't store names or organizations.
Comment #6
doublejosh commentedThis is an active and big problem.
Comment #7
elly commentedIn order to workaround this, I used auto_nodetitle to replace the node titles with the piece of the location I wanted to sort by (in my case, city) and used node title for the sort field in the view. This probably wouldn't work for most cases but it was a reasonable workaround for me.
Comment #8
xenophyle commentedThe status of this should be "active" since "needs work" means there is a patch that needs work.
Comment #9
rszrama commentedOk, I think I understand what's happening here. The issue appears to be that folks are adding an address field column to a View, rewriting the output to only show part of the address, and then expecting a click sort to sort based on the rewritten output instead of the data in the field itself. Unfortunately, that just isn't possible. Views sorting happens at the query level before the View results are ever rendered and output is rewritten. There's no way for a click sort to take into consideration just a specific part of the address when the column itself is a full address field.
If I end up committing it, this will provide the solution: #991834: Address component Views support
Comment #10
doublejosh commentedQuite right. That's exactly it.