File tree Expand file tree Collapse file tree
Model/ResourceModel/Page/Grid
Ui/Component/Listing/Column Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace Emico \AttributeLanding \Model \ResourceModel \Page \Grid ;
66
7- use Magento \Framework \Data \Collection \Db \FetchStrategyInterface ;
8- use Magento \Framework \Data \Collection \EntityFactoryInterface ;
9- use Magento \Framework \DB \Adapter \AdapterInterface ;
10- use Magento \Framework \Event \ManagerInterface ;
11- use Magento \Framework \Model \ResourceModel \Db \AbstractDb ;
127use Magento \Framework \View \Element \UiComponent \DataProvider \SearchResult ;
13- use Psr \Log \LoggerInterface ;
148use Zend_Db_Expr ;
159
1610class Collection extends SearchResult
Original file line number Diff line number Diff line change @@ -46,12 +46,12 @@ public function prepareDataSource(array $dataSource): array
4646 $ storeNames [(int ) $ store ->getId ()] = $ store ->getName ();
4747 }
4848
49- foreach ( $ dataSource [ ' data ' ][ ' items ' ] as & $ item ) {
50- $ columnName = $ this -> getData ( ' name ' );
51- $ raw = $ item [$ columnName ] ?? '' ;
49+ $ columnName = $ this -> getData ( ' name ' );
50+ foreach ( array_keys ( $ dataSource [ ' data ' ][ ' items ' ]) as $ index ) {
51+ $ raw = $ dataSource [ ' data ' ][ ' items ' ][ $ index ] [$ columnName ] ?? '' ;
5252
5353 if ($ raw === '' || $ raw === null ) {
54- $ item [$ columnName ] = '' ;
54+ $ dataSource [ ' data ' ][ ' items ' ][ $ index ] [$ columnName ] = '' ;
5555 continue ;
5656 }
5757
@@ -67,7 +67,7 @@ public function prepareDataSource(array $dataSource): array
6767 $ lines [] = sprintf ('%s: %s ' , $ storeName , $ urlPath );
6868 }
6969
70- $ item [$ columnName ] = implode ('<br/> ' , $ lines );
70+ $ dataSource [ ' data ' ][ ' items ' ][ $ index ] [$ columnName ] = implode ('<br/> ' , $ lines );
7171 }
7272
7373 return $ dataSource ;
You can’t perform that action at this time.
0 commit comments