If the site administrator enables the "hide country selection" setting and uses it with the "default country selection" setting from a=admin/settings/location, it is still possible for the site admin to de-select, from the default workflow, the collection of a country. If that happens, then no country goes into the database and none of the functions will work because calls to functions on locations are delegated to country-specific functions. If a location array lacks a country field, then the lack of a delegated to function will result in an empty value being returned.

That means that links won't be generated and locations won't be themed properly.

The solution is to edit the 'settings' case for location_nodeapi() (the case where the hook_nodeapi() returns the default workflow settings) so that the only $options passed to location are

1 => 'Allow a country to be submitted for nodes of this type.'
2 => 'Require a country to be submitted for nodes of this type.'

The option

0 => 'Do not collect a country for nodes of this type.'

needs to be removed.

As a result, the variable_get()s for these settings will need to be updated so that they default to option '1'.

-Ankur

Comments

ankur’s picture

Committed to CVS HEAD and DRUPAL-4-6

The changes to location.module require that users go through the content-type settings for each node type where the collection of location fields was previously enabled... What is specifically required is checking the box marked "Enable for locations".

For a diff to the previous revision of location.module, please see
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/location/loca...

-Ankur

Anonymous’s picture