File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments