Filter province as string
JaredAM - November 5, 2009 - 23:14
| Project: | Location |
| Version: | 6.x-3.0 |
| Component: | Location_views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Is it possible to override the default views_data for the province field? I'd like to change the handler from location_handler_filter_location_province to simply views_handler_filter_string.
I would like to search for multiple provinces. It looks like in location_handler_filter_location_province.inc that there was consideration for multiple provinces, but the operator is "IS" rather than "WORD".

#1
On consideration, I noticed that the module had intended to handle multiple values, but the code wasn't quite complete.
I created a patch to add this functionality.
Modified location_handler_filter_location_province.inc to provide "word" (Contains any word) and a "not word" (Does not contain) operators.
Modified location.module function _location_autocomplete to handle a comma separated list of provinces.
The "is" and "word" (as well as "is not" and "not word") will both have the same functionality. The new operators are basically given as an option to prevent user confusion.
#2
I tested the patch for unexposed fields, but when province is exposed, views returns an array rather than a string. Patch has been modified to anticipate this.