I’m having issues with this code from the start of _addresses_province_ajax:

  // Keep the same language between calls so that t() calls work as expected
  if (!empty($_GET['language'])) {
    $languages = language_list(); // get all languages
    if (isset($languages[$_GET['language']])) {
      $language = $languages[$_GET['language']];
    }
  }

If I dump the $_GET['language'] variable, it is an array, like this array('da', 'da');.
This is rather odd, but I haven't seen any other modules futzing with $_GET['langauge']. Any ideas?

Comments

AlexisWilke’s picture

The $_GET['language'] variable is used by the Core translation module.

function translation_nodeapi(&$node, $op, $teaser, $page)
  [...]
  switch ($op) {
    case 'prepare':
      if (empty($node->nid) && user_access('translate content') && isset($_GET['translation']) && isset($_GET['language']) && is_numeric($_GET['translation'])) {
        $translation_source = node_load($_GET['translation']);
        if (empty($translation_source) || !node_access('view', $translation_source)) {
          // Source node not found or no access to view. We should not check
          // for edit access, since the translator might not have permissions
          // to edit the source node but should still be able to translate.
          return;
        }
        $language_list = language_list();
        if (!isset($language_list[$_GET['language']]) || ($translation_source->language == $_GET['language'])) {
          // If not supported language, or same language as source node, break.
          return;
        }
        // Populate fields based on source node.
        $node->language = $_GET['language'];

From what I can tell, the usage in addresses is similar, except that it sets the $language global variable and that I think is wrong... I did not write that code and am unsure why it's there. It seems to me that it isn't necessary.

Thank you.
Alexis