Opened 6 years ago

Closed 5 years ago

#1989 closed unknown (wontfix)

Search for countries broken

Reported by: shevek Owned by:
Priority: major Milestone: unassigned
Component: BW Search Keywords:


Follow-up to #1807:

It does not fix the problem with Willemstad, Curacao .

Curacao problem is a geonames issue in our database: CW exists in geonames_cache.fk_countrycode but not in geonames_countries.iso_alpha2

The following query in test database shows that this is the unique problem of this type:

SELECT distinct geonames_cache.fk_countrycode

FROM geonames_cache

WHERE not exists 
(SELECT distinct geonames_cache.fk_countrycode

FROM geonames_countries

WHERE geonames_countries.iso_alpha2=geonames_cache.fk_countrycode )

According to, I suggest to execute the following query:

insert into geonames_countries 
(iso_alpha2, name, continent, languages) 
values ('CW', 'Curacao', 'EU', 'nl-NL,fy-NL');

Still not working, due to this code in searchmembers.model.php on line 622:

if (!empty($cities)) {
                $WhereCity = 'geonames_cache.geonameid IN (' . implode(',', $cities) . ')';
            } else {
                $WhereCity = "1 = 0";

Here we do a search by country, so I don't understand why is this $whereCity is not just skipped.

The call to findLocationsByCoordinates returns only one result, Curacao as a country, and does not return Willemstad, so there is no city in the list.

I see 2 options here:

  • search by country, so remove the '1=0'
  • ignore countries in findLocationsByCoordinates so the first city will be returned.

This has to be analysed much more, and also tested.

Let's see after the current release.

Change History (2)

comment:1 Changed 6 years ago by sitatara

  • Component changed from unknown to BW Search

comment:2 Changed 5 years ago by crumbking

  • Resolution set to wontfix
  • Status changed from new to closed

I searched with the new search (bw/search) and it seems to work. As bw/searchmembers is depreciated I close this one.

Note: See TracTickets for help on using tickets.