File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
app/code/Magento/Backend/Block/Widget/Grid/Massaction Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
use Magento \Backend \Block \Widget \Grid \Massaction \VisibilityCheckerInterface as VisibilityChecker ;
10
10
use Magento \Framework \DataObject ;
11
+ use Magento \Framework \Data \Collection \AbstractDb ;
11
12
12
13
/**
13
14
* Grid widget massaction block
@@ -277,16 +278,19 @@ public function getGridIdsJson()
277
278
}
278
279
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
279
280
$ allIdsCollection = clone $ this ->getParentBlock ()->getCollection ();
281
+
280
282
if ($ this ->getMassactionIdField ()) {
281
283
$ massActionIdField = $ this ->getMassactionIdField ();
282
284
} else {
283
285
$ massActionIdField = $ this ->getParentBlock ()->getMassactionIdField ();
284
286
}
285
- $ allIdsCollection = clone $ allIdsCollection ->getSelect ();
286
- $ allIdsCollection ->reset (\Magento \Framework \DB \Select::LIMIT_COUNT );
287
- $ allIdsCollection ->columns ($ massActionIdField , 'main_table ' );
288
- $ resourse = \Magento \Framework \App \ObjectManager::getInstance ()->create ('Magento\Framework\App\ResourceConnection ' );
289
- $ gridIds = $ resourse ->getConnection ()->fetchCol ($ allIdsCollection );
287
+
288
+ if ($ allIdsCollection instanceof AbstractDb) {
289
+ $ allIdsCollection ->getSelect ()->limit ();
290
+ $ allIdsCollection ->clear ();
291
+ }
292
+
293
+ $ gridIds = $ allIdsCollection ->setPageSize (0 )->getColumnValues ($ massActionIdField );
290
294
if (!empty ($ gridIds )) {
291
295
return join (", " , $ gridIds );
292
296
}
You can’t perform that action at this time.
0 commit comments