]> _ Git - fluidbook-toolbox.git/commitdiff
try #8009 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Feb 2026 17:44:02 +0000 (18:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Feb 2026 17:44:02 +0000 (18:44 +0100)
app/Fluidbook/SearchIndex.php
app/Models/ToolWebflow.php

index 25008be4e858764faa104517c4cb5b2162e88941..8386abfbb9a8f2ba4704f91b43892c857008ca15 100644 (file)
@@ -139,7 +139,7 @@ class SearchIndex
             }
 
             if (!isset($index[$woa])) {
-                $index[$woa] = array('t' => 0, 'p' => array());
+                $index[$woa] = array('t' => 0, 'p' => [], 'w' => []);
             }
             $index[$woa]['t'] += (int)$total;
 
@@ -150,7 +150,12 @@ class SearchIndex
                     $index[$woa]['p'][$page] = 0;
                 }
                 $index[$woa]['p'][$page] += (int)$count;
+                if (!isset($index[$woa]['w'][$wordwa])) {
+                    $index[$woa]['w'][$wordwa] = 0;
+                }
+                $index[$woa]['w'][$wordwa] += (int)$count;
             }
+            arsort($index[$woa]['w']);
         }
     }
 
index 320a7e6f19382fffc6b94eff873ac0eb8c25f78b..96cfbcdaecc493357c46cb65a7a6a34a0f773437 100644 (file)
@@ -334,9 +334,11 @@ class ToolWebflow extends ToolboxTranslatableModel
                 if (!isset($data[$locale])) {
                     $data[$locale] = [];
                 }
-                foreach ($data[$mainLocale] as $id => $alt) {
-                    if (!isset($data[$locale][$id]) || !$data[$locale][$id]) {
-                        $data[$locale][$id] = $alt ? $translateAPI->translate($alt, $locale, $mainLocale) : '';
+                if(isset($data[$mainLocale])) {
+                    foreach ($data[$mainLocale] as $id => $alt) {
+                        if (!isset($data[$locale][$id]) || !$data[$locale][$id]) {
+                            $data[$locale][$id] = $alt ? $translateAPI->translate($alt, $locale, $mainLocale) : '';
+                        }
                     }
                 }
             }