Skip to content

Commit

Permalink
Merge pull request #29 from dragomano/fix_release
Browse files Browse the repository at this point in the history
Fix import and export
  • Loading branch information
dragomano authored Aug 28, 2021
2 parents 08c9747 + 0829766 commit d1c849d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Sources/LightPortal/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 1 addition & 2 deletions Sources/LightPortal/impex/BlockExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
4 changes: 2 additions & 2 deletions Sources/LightPortal/impex/PageExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions Sources/LightPortal/impex/PageImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -200,7 +200,7 @@ protected function run()
}
}

if (!empty($items) && !empty($result)) {
if (!empty($items)) {
$items = array_chunk($items, 100);
$count = sizeof($items);

Expand Down
2 changes: 1 addition & 1 deletion package-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>Bugo:LightPortal</id>
<name>Light Portal</name>
<version>1.8.1</version>
<version>1.8.2</version>
<type>modification</type>

<install for="2.1.*">
Expand Down

0 comments on commit d1c849d

Please sign in to comment.