--- checkout.module.orig 2008-08-06 14:48:53.000000000 +0200 +++ checkout.module 2008-08-06 15:00:00.000000000 +0200 @@ -179,7 +179,7 @@ * The user id to (un)lock nodes for. */ function checkout_handle_request($uid) { - global $base_path; + global $base_path, $language; // Build referer path $referer_uri = parse_url(referer_uri()); @@ -197,6 +197,19 @@ $referer = drupal_get_normal_path($referer); } + // $_GET['q'] doesn't have a language prefix, referer_uri does (if defined). + // Remove it from $referer to enable comparison with $_GET['q']. + if (!empty($language->prefix)) { + // Check language_negotiation mode because prefix can be defined without + // using it in URLs, and someone could define a fixed path starting + // with the same string as a language prefix. + $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); + switch ($mode) { + case LANGUAGE_NEGOTIATION_PATH_DEFAULT: + case LANGUAGE_NEGOTIATION_PATH: + $referer = preg_replace("?^". $language->prefix ."/?",'',$referer); + } + } // If refering and current paths match we can abort, since there can't be any // locking action involved. if ($_GET['q'] == $referer) {