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".

Comments

JaredAM’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new4.62 KB

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.

JaredAM’s picture

StatusFileSize
new5.86 KB

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.

drumnjo’s picture

subscribe

kruser’s picture

subscribe

yesct’s picture

tagging.

kruser’s picture

Status: Needs review » Reviewed & tested by the community

This patch work well, can it be committed?

rooby’s picture

Title: Filter province as string » Allow multiple values for views province filter
Version: 6.x-3.0 » 6.x-3.x-dev
Category: feature » bug
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.72 KB

Marking as a bug as the "Force single" views option does not work.

Thanks for the patch, this is definitely needed.

I have a couple of issues with the patch in #2 though:
* It changes the autocomplete functionality so that province fields anywhere will take multiple values. This is not desirable.
* The "word"/"not word" stuff makes things more confusing.

Here is a new patch that:
* Makes the "Force single" option actually do what it says. If unchecked the user can enter a comma delimited list of provinces using auto complete.
* Changes the autocomplete function so that it can be used with multiple values or a single value.

For my testing it works if others can test it would be great.

rooby’s picture

I just committed another patch that will break the patch in #7.

After the next dev version comes up you will nee to use this patch instead so it will apply properly.

liminu’s picture

Patch number #8 works well, you need to put the comma between the 2 province, but with the attachment views not work, any idea to fix it.

mattcasey’s picture

I think that this is not working with arguments. I am trying to filter by Location attached to a Content Profile node on the user profile. When I use UID as an argument, it shows nothing if I have more than one province. Multiple provinces work fine when there is no argument.

podarok’s picture

Status: Needs review » Active

bot recall

podarok’s picture

Status: Active » Needs review

bot

Status: Needs review » Needs work
Issue tags: -location views, -location views handler

The last submitted patch, location-province_filter_multiple-624842-8.patch, failed testing.

legolasbo’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Closing old D6 issues as D6 is end of life