Skip to content

Commit c72ca6c

Browse files
authored
Merge pull request #415 from magefan/6483-Magento-2-Blog-Import
6483-Magento-2-Blog-Import
2 parents 28ae257 + 1eb5228 commit c72ca6c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Model/Import/Aw2.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function execute()
4949

5050
/* Find store ids */
5151
$data['store_ids'] = [];
52-
$s_sql = 'SELECT
53-
`store_id`
54-
FROM
55-
'.$_pref.'`aw_blog_category_store`
56-
WHERE
52+
$s_sql = 'SELECT
53+
`store_id`
54+
FROM
55+
'.$_pref.'`aw_blog_category_store`
56+
WHERE
5757
`category_id` = '. ((int)$data['old_id']) . ";";
5858
$s_result = $adapter->query($s_sql)->execute();
5959
foreach ($s_result as $s_data) {
@@ -169,6 +169,10 @@ public function execute()
169169
if (empty($data['store_ids']) || in_array(0, $data['store_ids'])) {
170170
$data['store_ids'] = 0;
171171
}
172+
if (!empty($data['featured_image_file'])) {
173+
$imgPath = explode('/', $data['featured_image_file']);
174+
$img = end($imgPath);
175+
}
172176

173177
/* Prepare post data */
174178
$data = [
@@ -185,7 +189,7 @@ public function execute()
185189
'publish_time' => strtotime($data['publish_date']),
186190
'is_active' => (int)($data['status'] == 'publication'),
187191
'categories' => $postCategories,
188-
'featured_img' => !empty($data['featured_image']) ? 'magefan_blog/' . $data['featured_image'] : '',
192+
'featured_img' => !empty($img) ? 'magefan_blog/' . $img : '',
189193
];
190194
$data['identifier'] = trim(strtolower($data['identifier']));
191195

0 commit comments

Comments
 (0)