From 658e5331dff13b7571bf3190f4c77a88c5519bea Mon Sep 17 00:00:00 2001
From: OnkelTem <OnkelTem@239962.no-reply.drupal.org>
Date: Sat, 11 Oct 2014 16:56:24 +0400
Subject: [PATCH] Issue 1893878: Duplicated path prefix in urls when using
 Path Breadcrumbs render function

---
 path_breadcrumbs.module |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/path_breadcrumbs.module b/path_breadcrumbs.module
index 084e7e7..3ef5cf0 100644
--- a/path_breadcrumbs.module
+++ b/path_breadcrumbs.module
@@ -56,7 +56,7 @@ function path_breadcrumbs_set_breadcrumb($path = NULL) {
  *    - build: built Path Breadcrumbs array ready for drupal_set_breadcrumb().
  */
 function path_breadcrumbs_load_variant($path) {
-  global $language;
+  global $language_url;
 
   if (empty($path)) {
     return FALSE;
@@ -72,7 +72,7 @@ function path_breadcrumbs_load_variant($path) {
 
   if ($cache_enabled) {
     // Trying to load breadcrumb from cache.
-    $cache_id = __FUNCTION__ . ':' . $path . ':' . $language->language;
+    $cache_id = __FUNCTION__ . ':' . $path . ':' . $language_url->language;
     $cache = cache_get($cache_id, PATH_BREADCRUMBS_CACHE_STORAGE);
     if (!empty($cache->data)) {
       // Empty results are also cached.
@@ -371,7 +371,7 @@ function path_breadcrumbs_breadcrumb($variables) {
       $href = '';
       if (!empty($matches[1])) {
         global $base_path;
-        global $language;
+        global $language_url;
 
         $base_string = rtrim($base_path, "/");
 
@@ -383,8 +383,8 @@ function path_breadcrumbs_breadcrumb($variables) {
         // Append additional params to base string for multilingual sites.
         // @note: Only core URL detection method supported.
         $enabled_negotiation_types = variable_get("language_negotiation_language", array());
-        if (!empty($enabled_negotiation_types['locale-url']) && !empty($language->prefix)) {
-          $base_string .= '/' . $language->prefix;
+        if (!empty($enabled_negotiation_types['locale-url']) && !empty($language_url->prefix)) {
+          $base_string .= '/' . $language_url->prefix;
         }
 
         // Means that this is href to the frontpage.
-- 
1.7.9.5

