diff --git a/location.install b/location.install index 07bfddfa985264b3261068a0c29cdc47604b99c1..7b097ec08f89eebf62fd944b54d651c02d51cf4b 100644 --- a/location.install +++ b/location.install @@ -1071,24 +1071,32 @@ function location_update_6304() { } /** - * Add per-location-field weights and defaults. + * Disabled due to some typos, moved to 6306. */ function location_update_6305() { + return array(); +} + + +/** + * Add per-location-field weights and defaults. + */ +function location_update_6306() { $ret = array(); $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'location_settings_%'"); while ($row = db_fetch_object($result)) { - $var = variable_get($result->name, array()); + $var = variable_get($row->name, array()); $collect = $var['form']['fields']; $var['form']['fields'] = array(); foreach ($collect as $k => $v) { $var['form']['fields'][$k]['collect'] = $v; } // Country 3 has changed to 4 to make requirements code easier. - if (isset($var['form']['fields']['country']) && $var['form']['fields']['country'] == 3) { - $var['form']['fields']['country'] = 4; + if (isset($var['form']['fields']['country']['collect']) && $var['form']['fields']['country']['collect'] == 3) { + $var['form']['fields']['country']['collect'] = 4; } // Weight and default values don't need to get set for now. - variable_set($result->name, $var); + variable_set($row->name, $var); } return $ret; }