From 0829766bb4a01865c70f633341c78ba6dc575dbb Mon Sep 17 00:00:00 2001 From: Bugo Date: Sat, 28 Aug 2021 08:53:51 +0500 Subject: [PATCH] Fix import and export --- Sources/LightPortal/Integration.php | 4 ++-- Sources/LightPortal/impex/BlockExport.php | 3 +-- Sources/LightPortal/impex/PageExport.php | 4 ++-- Sources/LightPortal/impex/PageImport.php | 8 ++++---- package-info.xml | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Sources/LightPortal/Integration.php b/Sources/LightPortal/Integration.php index 7b89ae423..00e4f4aea 100644 --- a/Sources/LightPortal/Integration.php +++ b/Sources/LightPortal/Integration.php @@ -76,8 +76,8 @@ public function userInfo() $lp_constants = [ 'LP_NAME' => 'Light Portal', - 'LP_VERSION' => '1.8.1', - 'LP_RELEASE_DATE' => '2021-07-24', + 'LP_VERSION' => '1.8.2', + 'LP_RELEASE_DATE' => '2021-08-28', 'LP_DEBUG' => !empty($modSettings['lp_show_debug_info']) && !empty($user_info['is_admin']), 'LP_CACHE_TIME' => $modSettings['lp_cache_update_interval'] ?? 3600, 'LP_ADDON_DIR' => $sourcedir . '/LightPortal/addons' diff --git a/Sources/LightPortal/impex/BlockExport.php b/Sources/LightPortal/impex/BlockExport.php index a7add8c54..20465e2f9 100644 --- a/Sources/LightPortal/impex/BlockExport.php +++ b/Sources/LightPortal/impex/BlockExport.php @@ -80,8 +80,7 @@ protected function getData(): array if (!isset($items[$row['block_id']])) $items[$row['block_id']] = array( 'block_id' => $row['block_id'], - 'icon' => $row['icon'], - 'icon_type' => $row['icon_type'], + 'icon' => $row['icon_type'] . 'fa-' . $row['icon'], 'type' => $row['type'], 'note' => $row['note'], 'content' => $row['content'], diff --git a/Sources/LightPortal/impex/PageExport.php b/Sources/LightPortal/impex/PageExport.php index 57d5805a4..16541021f 100644 --- a/Sources/LightPortal/impex/PageExport.php +++ b/Sources/LightPortal/impex/PageExport.php @@ -215,7 +215,7 @@ protected function getData(): array */ protected function getCategories(): array { - $categories = (new \Bugo\LightPortal\Category)->getList(); + $categories = (new \Bugo\LightPortal\Lists\Category)->getList(); unset($categories[0]); @@ -233,7 +233,7 @@ protected function getCategories(): array */ protected function getTags(): array { - $tags = (new \Bugo\LightPortal\Tag)->getList(); + $tags = (new \Bugo\LightPortal\Lists\Tag)->getList(); ksort($tags); diff --git a/Sources/LightPortal/impex/PageImport.php b/Sources/LightPortal/impex/PageImport.php index b09165a6f..a48d4f047 100644 --- a/Sources/LightPortal/impex/PageImport.php +++ b/Sources/LightPortal/impex/PageImport.php @@ -164,7 +164,7 @@ protected function run() } if (!empty($categories)) { - $result = $smcFunc['db_insert']('replace', + $smcFunc['db_insert']('replace', '{db_prefix}lp_categories', array( 'category_id' => 'int', @@ -180,12 +180,12 @@ protected function run() $smcFunc['lp_num_queries']++; } - if (!empty($tags) && !empty($result)) { + if (!empty($tags)) { $tags = array_chunk($tags, 100); $count = sizeof($tags); for ($i = 0; $i < $count; $i++) { - $result = $smcFunc['db_insert']('replace', + $smcFunc['db_insert']('replace', '{db_prefix}lp_tags', array( 'tag_id' => 'int', @@ -200,7 +200,7 @@ protected function run() } } - if (!empty($items) && !empty($result)) { + if (!empty($items)) { $items = array_chunk($items, 100); $count = sizeof($items); diff --git a/package-info.xml b/package-info.xml index 1d755dcb8..904b620e6 100644 --- a/package-info.xml +++ b/package-info.xml @@ -3,7 +3,7 @@ Bugo:LightPortal Light Portal - 1.8.1 + 1.8.2 modification