Skip to content

Commit

Permalink
PHP8: base64_decode(): Passing null is deprecated (#4281)
Browse files Browse the repository at this point in the history
* PHP8: base64_decode(): Passing null to parameter MahoCommerce#1 ($string) of type string is deprecated

- OpenMage/magento-lts#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 <kiatsiong.ng@gmail.com>

---------

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
  • Loading branch information
2 people authored and github-actions[bot] committed Oct 19, 2024
1 parent 578333f commit 35ee19a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
31 changes: 24 additions & 7 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,38 @@ protected function _prepareColumns()
);
}

$this->addRssFeedLink();

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
}

/**
* Add link to RSS feed when enabled for filtered store-view
*
* @return $this
* @throws Mage_Core_Model_Store_Exception
*/
public function addRssFeedLink()
{
if (Mage::helper('sales')->isModuleOutputEnabled('Mage_Rss')) {
$filterString = $this->getParam($this->getVarNameFilter());
$filter = Mage::helper('adminhtml')->prepareFilterString($filterString);
$storeId = array_key_exists('store_id', $filter) ? $filter['store_id'] : null;
$storeId = null;

$filterString = $this->getParam($this->getVarNameFilter(), '');
if ($filterString) {
$filter = Mage::helper('adminhtml')->prepareFilterString($filterString);
$storeId = $filter['store_id'] ?? null;
}

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

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));

return parent::_prepareColumns();
return $this;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function removeColumn($columnId)
* @param string $columnId
* @param array|Varien_Object $column
* @param string $after
* @return Mage_Adminhtml_Block_Widget_Grid
* @return $this
* @throws Exception
*/
public function addColumnAfter($columnId, $column, $after)
Expand Down Expand Up @@ -963,7 +963,7 @@ public function getExportTypes()
*
* @param string $url
* @param string $label
* @return Mage_Adminhtml_Block_Widget_Grid
* @return $this
*/
public function addExportType($url, $label)
{
Expand Down Expand Up @@ -1009,7 +1009,7 @@ protected function _getRssUrl($url)
*
* @param string $url
* @param string $label
* @return Mage_Adminhtml_Block_Widget_Grid
* @return $this
* @throws Mage_Core_Model_Store_Exception
*/
public function addRssList($url, $label)
Expand Down Expand Up @@ -1803,7 +1803,7 @@ public function getRowspan($item, $column)
/**
* @param string|object $column
* @param string $value
* @return bool|Mage_Adminhtml_Block_Widget_Grid
* @return bool|$this
*/
public function isColumnGrouped($column, $value = null)
{
Expand Down

0 comments on commit 35ee19a

Please sign in to comment.