Skip to content

Commit fa6e859

Browse files
sreichelkiatng
andauthored
PHP8: base64_decode(): Passing null is deprecated (OpenMage#4281)
* PHP8: base64_decode(): Passing null to parameter #1 ($string) of type string is deprecated - OpenMage#4243 (comment) * refactor * refactor * refactor * refactor [skip ci] * Update app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php Co-authored-by: Ng Kiat Siong <[email protected]> --------- Co-authored-by: Ng Kiat Siong <[email protected]>
1 parent 01ed8fe commit fa6e859

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,38 @@ protected function _prepareColumns()
141141
);
142142
}
143143

144+
$this->addRssFeedLink();
145+
146+
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
147+
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
148+
149+
return parent::_prepareColumns();
150+
}
151+
152+
/**
153+
* Add link to RSS feed when enabled for filtered store-view
154+
*
155+
* @return $this
156+
* @throws Mage_Core_Model_Store_Exception
157+
*/
158+
public function addRssFeedLink()
159+
{
144160
if (Mage::helper('sales')->isModuleOutputEnabled('Mage_Rss')) {
145-
$filterString = $this->getParam($this->getVarNameFilter());
146-
$filter = Mage::helper('adminhtml')->prepareFilterString($filterString);
147-
$storeId = array_key_exists('store_id', $filter) ? $filter['store_id'] : null;
161+
$storeId = null;
162+
163+
$filterString = $this->getParam($this->getVarNameFilter(), '');
164+
if ($filterString) {
165+
$filter = Mage::helper('adminhtml')->prepareFilterString($filterString);
166+
$storeId = $filter['store_id'] ?? null;
167+
}
148168

149169
if (Mage::helper('rss')->isRssAdminOrderNewEnabled($storeId)) {
150170
$slug = $storeId ? '/store/' . $storeId : '';
151171
$this->addRssList('rss/order/new' . $slug, Mage::helper('sales')->__('New Order RSS'));
152172
}
153173
}
154174

155-
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
156-
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
157-
158-
return parent::_prepareColumns();
175+
return $this;
159176
}
160177

161178
/**

app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public function removeColumn($columnId)
372372
* @param string $columnId
373373
* @param array|Varien_Object $column
374374
* @param string $after
375-
* @return Mage_Adminhtml_Block_Widget_Grid
375+
* @return $this
376376
* @throws Exception
377377
*/
378378
public function addColumnAfter($columnId, $column, $after)
@@ -964,7 +964,7 @@ public function getExportTypes()
964964
*
965965
* @param string $url
966966
* @param string $label
967-
* @return Mage_Adminhtml_Block_Widget_Grid
967+
* @return $this
968968
*/
969969
public function addExportType($url, $label)
970970
{
@@ -1010,7 +1010,7 @@ protected function _getRssUrl($url)
10101010
*
10111011
* @param string $url
10121012
* @param string $label
1013-
* @return Mage_Adminhtml_Block_Widget_Grid
1013+
* @return $this
10141014
* @throws Mage_Core_Model_Store_Exception
10151015
*/
10161016
public function addRssList($url, $label)
@@ -1757,7 +1757,7 @@ public function getRowspan($item, $column)
17571757
/**
17581758
* @param string|object $column
17591759
* @param string $value
1760-
* @return bool|Mage_Adminhtml_Block_Widget_Grid
1760+
* @return bool|$this
17611761
*/
17621762
public function isColumnGrouped($column, $value = null)
17631763
{

0 commit comments

Comments
 (0)