]> _ Git - cubist_cms-back.git/commitdiff
wip #3262 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 12 Dec 2019 18:38:38 +0000 (19:38 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 12 Dec 2019 18:38:38 +0000 (19:38 +0100)
src/app/Magic/Menu/Item.php
src/app/Magic/Models/Locale.php

index 2fce0a806d6966db113ce954808ed18c65a62bc2..ed6c642afa8710e11e9f83c718b07b12a348554b 100644 (file)
@@ -406,7 +406,7 @@ class Item
         if (!$domain) {
             return $href;
         }
-        return 'https://' . $domain . $href;
+        return rtrim('https://' . $domain . '/' . $href, '/');
     }
 
     public function isNavigable()
@@ -432,6 +432,9 @@ class Item
      */
     public function addChild($item)
     {
+        if ($item->getRawLocale() === '') {
+            $item->setLocale($this->getLocale());
+        }
         $this->_children[] = $item;
     }
 
@@ -586,6 +589,11 @@ class Item
         return $res;
     }
 
+    public function getRawLocale()
+    {
+        return $this->_locale;
+    }
+
     /**
      * @return string
      */
index d321a00e5e793e3af2d8e5e97f06d4f393d6c828..5ac91d0660003b5d26e47d887018f5db9c0c3d93 100644 (file)
@@ -136,10 +136,10 @@ class Locale extends CubistMagicAbstractModel
     {
         if (!isset(self::$_mainDomains[$locale])) {
             $all = self::getLocalesData();
-            if (!isset($all[$locale])) {
+            if (!isset($all['locales'][$locale])) {
                 return false;
             }
-            $domains = $all[$locale]->domains;
+            $domains = $all['locales'][$locale]->domains;
             if (is_string($domains)) {
                 $domains = json_decode($domains, true);
             }