Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Location_views
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2011 at 08:51 UTC
Updated:
24 Sep 2013 at 14:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
clashar commentedI've just tried Location 7.4 dev, the same error
Comment #2
dawehnerThis seems to be a bug of location module?
Comment #3
clashar commenteddereine, thanks for pointing, I wasn't sure of which module could bug belong to.
Comment #4
justmagicmaria commentedSame issue. Subscribing.
Comment #5
salientknight commentedSame issue... started happening after last weeks views upgrade.
Comment #6
Matayou commentedSubscribing, similar issue
Comment #7
mmilo commentedThis can be fixed if location_handler_filter_location_country uses the default parent class... ie:
becomes
Rather tired to make a patch.
Comment #8
justmagicmaria commented@mmilo Actually, when I make that change I get:
Fatal error: Call to undefined method location_handler_filter_location_country::operator_values() in /Users/mariagreene/projects/dollinghouse/drupal7/sites/all/modules/location/handlers/location_handler_filter_location_country.inc on line 43
Comment #9
dgastudio commentedsame error
Comment #10
vensiresThis also happens on 6.x-3.x-dev after the last week upgrading
Comment #11
ankur commentedLooks like there are several issues with the country filter.
Here's a patch for the 7.x-3.x branch that tries to address them. If you do test it, please post back here with your results.
Comment #12
Sinovchi commentedI manually applyed patch #11 to latest dev version of location - 6.x-3.x-dev. It works for single country only. For multiple countries it returns error:
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in Z:\home\mydomain.loc\www\includes\database.mysql.inc on line 329.
Nevertheless, thanks for the patch.
Comment #13
ankur commented@biarr in #12,
The patch is only intended for location 7.x-3.x, when being used with views 7.x-3.x.
I think location 6.x-3.x might still only be compatible with views 6.x-2.x, but not with views 6.x-3.x.
Comment #14
revjtanton commentedI have applied this patch and my versions are correct...nothing changed at all.
Should I delete my old views and make new ones?
Comment #15
vensiresIn 6.x as stated in #12 the filter works for only one country. As for 7.x I do not know. The only sure thing is that after applying the patch, your views will be immediately ready. You will only have to reconfigure the country filter. No need to recreate the whole views.
Comment #16
Tino commentedCouldn't patch #11 automatically, so I applied it manually to location_handler_filter_location_country.inc. It does do the trick tough. Thanks! Hope it will be fixed in the next 7.x-3.x-dev release.
Comment #17
uniqode commentedI have applied this patch but i'm getting an error
Call to undefined method location_handler_filter_location_country::operator_values()
Comment #18
uniqode commentedit should be
class location_handler_filter_location_country extends views_handler_filter_in_operator
and not
class location_handler_filter_location_country extends views_handler_filter
as views_handler_filter_in_operator already extends views_handler_filter
but otherwise patch works, thanks
Comment #19
ankur commented@emelja: If the parent class doesn't define the method, then this class should take it from the grandparent class.
I'd say make sure you're using the latest versions of everything and maybe clear all of your caches.
Comment #20
simon_s commentedPatch #11 works fine here with the current 7.x-3.x-dev. Thanks!
Comment #21
revjtanton commentedThe patch did not work for me, however I found the same problem @emelja33 found and now it works.
Comment #22
pasquallesame patch, just removed trailing spaces.. named Ankur as the patch author..
Comment #23
pasquallejust for the record, multiple selection of countries works correctly..
Comment #24
Refineo commentedI applied patch #22 to my environment:
- Drupal 7.10
- Location 7.x-3.x-dev
- Views 7.x-3.x-dev
The following two errors are solved:
1) When trying to edit view filter criteria:
admin/structure/views/view/frontpage/edit
Configure filter criterion: Location: Country
(SOLVED)
2) After saving the view there was an error:
(SOLVED)
Remaining issue
However now after applying this patch #22 when I select country (United States) from the exposed filter list, there is no content shown in the view although there is a published content node assigned to that country location.
When I select - Any - in a country exposed filter, I can see all records as expected.
Comment #25
pasqualle@refineo:
- enable "Show the SQL query" on the admin/structure/views/settings page
- try the preview button on the view edit page
- examine the sql, there should be something like:
"... WHERE ... location.country = 'us' ..."
- go to the database, make sure you have 'us' in the location table country column..
Comment #26
Refineo commentedok, I reinstalled this and patched the module again and now #23 - #24 works fine.
It was != 'us' instead of == 'us' before in sql.
Comment #27
Refineo commentedIMHO this is RTBC. Will you commit this patch soon ? Thank you !
Comment #28
ankur commentedThanks for the updated version of the patch in #22.
I went ahead and committed it to the 7.x-3.x branch.
Comment #29
pipep commentedPatch on #22 worked for me on D.7.10
However I have a question if anyone can help... I can't figure it out.
I have a content type with location required. I'm using views to show an excerpt of the nodes, and I want to filter them by country (the one the user selected when creating the node)
How can I filter the list of countries displayed on the dropdown, to only the ones that have nodes already created ?
let's say I have only 10 countries with related nodes, the dropdown should show only those. If a user adds a node with a new country, it should appear on the dropdown automatically...
Comment #30
Josh Benner commentedPatch in #11 rolled against 6.x-3.x-dev -- seems to be working? Haven't heavily tested yet.
Comment #31
Goekmen commentedI still get all countries with the latest dev version, what I am doing wrong?
The patch seem to be included.
Comment #32
aasarava commentedPatch in #30 seems to work on 6.x-3.x-dev.
Comment #33
Sinovchi commentedPatch in #30 works for single country only (when you select "Force single" in view). For multiple countries it still returns error:
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in ...\includes\database.mysql.inc on line 329.
Comment #34
darrellduane commentedPatch #30 also doesn't work for Filters that are not exposed in 6.x-3.x.
Comment #35
hongpong commentedre-opening this to 6.x and needs work, as we have a partial patch and this needs work! Really annoying, in my case it won't accept 1 country. Just need US & Canada to work as exposed filters!! [I think it's not overkill to just use this thread instead of opening a new one, since a 6.x conversation is developing]
Comment #36
darrellduane commented@HongPong thanks for reopening this, I'm not seeing this patch working for me under 6.x-3.x of views and am thankful that you validate my reality in this.
Comment #37
darrellduane commented@HongPong thanks for reopening this, I'm not seeing this patch working for me under 6.x-3.x of views and am thankful that you validate my reality in this.
Comment #38
hongpong commentedIn my case I am having trouble with a data set of US and Canadian Location entries, and the State/province level filter fails to recognize canadian provinces (the site info is set to United States which I gather may be related), as well as experiencing this error. (i figured maybe letting people pick US/Canada on the exposed filter might prompt it to let select the provinces - then i ran into this bug). It seems like Location has a myriad of issues with Views 3.x :/
Comment #39
general_ludd commentedI too am struggling with this particular property of the location module. No matter which way I try to configure the filter, it doesn't work. Without the country, the state/province filter only seems to work for the United States (in my case) and we have Canadian entries that need to be included in the filter. Poor Canadians.
Comment #40
hongpong commentedit seems like the patch on #30 improved matters quite a bit. I had to apply it manually but it does make the multi-country exposed filter (selecting a single country, Canada, and causing the province to auto-fill, only for provinces that have 1+ result). So that is good news, thanks Josh Benner!
Comment #41
yannickooCan confirm that #30 works for current development version. I just re-rolled the patch so that it is easy to apply with Git.
Comment #42
podarokbot recall
Comment #43
podarokbot
Comment #44
podarok#41 pushed to 6.x-3.x-dev
Thanks!