Created a constant define('LOCATION_PATH', drupal_get_path('module', 'location'));
Replaced all occurances of 'modules/location' with LOCATION_PATH.
Now module works on multi-site setup.

Additionally (violating the rule of 1 bug per patch) changed the number of characters getting truncated from the province var in location_form2api. Was set at 3 but this wasn't working in my installation so I changed it to 2. Looks like the format was once us-MI but is no usMI.

Comments

robertdouglass’s picture

StatusFileSize
new46.4 KB

no idea why the patch is so large and messy. It applies to both files (from the location folder level). I'll go ahead and make patches for the two individual files - maybe that will be easier for you.

Attached is location.module patch

robertdouglass’s picture

StatusFileSize
new3.26 KB

and location.inc patch. At least this one is easier to read.

ankur’s picture

Hey Robert,

I was taking a look at the code and realized that the error that causes the missing dash in what should be 'us-MI' is a bug in the function _location_province_select_options().

The line that reads

$options_list[$countrycodes[0] . $province_code] = $province_name;

should really be

$options_list[$countrycodes[0] . '-' . $province_code] = $province_name;

Would you be willing to change the patch to make this correction? I'm really interested in using the drupal_set_path() fix you submitted. I know that the lack of drupal_set_path() was an issue, but didn't really know how to use the function. I wanted to look it up before I went on vacation, but it was one of the many tweaks on my list of things to fix. Thanks for the patch though. I will commit it (or ask you to commit it) when I get to back to the linux box in the office (committing patches from a Windows machine causes an issue with carriage returns vs linebreaks, which is why the patch files look messy even if you are changing a few lines).

-Ankur

robertdouglass’s picture

Hi Ankur,

I committed the changes. Great module, by the way :-)