Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Magento\Backend\Block\Widget\Grid\Massaction;

use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\DataObject;

/**
Expand Down Expand Up @@ -51,7 +52,7 @@ public function __construct(
}

/**
* @return void
* @inheritdoc
*/
protected function _construct()
{
Expand Down Expand Up @@ -214,8 +215,9 @@ public function getGridJsObjectName()

/**
* Retrieve JSON string of selected checkboxes
*
*
* @return string
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
*/
public function getSelectedJson()
{
Expand All @@ -230,6 +232,7 @@ public function getSelectedJson()
* Retrieve array of selected checkboxes
*
* @return string[]
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
*/
public function getSelected()
{
Expand All @@ -251,6 +254,8 @@ public function getApplyButtonHtml()
}

/**
* Get mass action javascript code.
*
* @return string
*/
public function getJavaScript()
Expand All @@ -267,6 +272,8 @@ public function getJavaScript()
}

/**
* Get grid ids in JSON format.
*
* @return string
*/
public function getGridIdsJson()
Expand All @@ -282,7 +289,11 @@ public function getGridIdsJson()
} else {
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
}

if ($allIdsCollection instanceof AbstractDb) {
$allIdsCollection->getSelect()->limit();
$allIdsCollection->clear();
}

$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
if (!empty($gridIds)) {
return join(",", $gridIds);
Expand All @@ -291,6 +302,8 @@ public function getGridIdsJson()
}

/**
* Get Html id.
*
* @return string
*/
public function getHtmlId()
Expand Down