]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5795 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 15 Mar 2023 16:56:41 +0000 (17:56 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 15 Mar 2023 16:56:41 +0000 (17:56 +0100)
app/Fluidbook/SEO/Document.php

index 21c51b4e19d0c44f8490d0184c14560389e68c09..4ac319a2e407d15e38068448cc9c8238696955ca 100644 (file)
@@ -2,10 +2,12 @@
 
 namespace App\Fluidbook\SEO;
 
+use App\Http\Controllers\Admin\Operations\Tools\Excel2JSON;
 use App\Jobs\FluidbookCompiler;
 use App\Models\FluidbookDocument;
-use App\Util\Excel;
-use Cubist\Util\Json;
+
+
+use Cubist\Excel\ExcelToArray;
 use Cubist\Util\Text;
 
 class Document
@@ -34,7 +36,7 @@ class Document
 
         $file = $this->compiler->getSetting('seoAdvanced', '');
         if ($file) {
-            $sheets = Excel::excelToArray($this->compiler->working_path($file), true);
+            $sheets = ExcelToArray::excelToAssoc($this->compiler->working_path($file), true);
             foreach ($sheets as $sheet) {
                 $a = $sheet;
                 break;
@@ -47,7 +49,10 @@ class Document
 
             foreach ($a as $item) {
                 $page = $item['page'] + $offsetPage;
-                $item['url'] = Text::removeAccents($item['url']);
+                $item['url'] = trim(Text::removeAccents($item['url']), " '");
+                if (!$item['url']) {
+                    continue;
+                }
                 foreach ($item as $k => $v) {
                     if ($k == 'page') {
                         continue;