From 22c8fb7051db25f6215d7f274fe1ce75bea350bb Mon Sep 17 00:00:00 2001 From: Loek van Gool Date: Tue, 2 Apr 2024 21:27:37 +0200 Subject: [PATCH 1/3] Add the column ID name to the in absence of a link It's possible to determine the column name for admin grids, but not if they are not sortable. I propose to add this. --- .../Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 436131036c8..8cf4a33e160 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -115,7 +115,7 @@ protected function _getInputValue(Varien_Object $row) /** * @return string */ - public function renderHeader() + public function renderHeader(): string { if ($this->getColumn()->getGrid()->getSortable() !== false && $this->getColumn()->getSortable() !== false) { $className = 'not-sort'; @@ -128,7 +128,7 @@ public function renderHeader() . '" class="' . $className . '">' . $this->escapeHtml($this->getColumn()->getHeader()) . ''; } else { - $out = $this->escapeHtml($this->getColumn()->getHeader()); + $out = ''.$this->escapeHtml($this->getColumn()->getHeader()) . ''; } return $out; } From 23f184dc08468e136051d5898c63e4aace08f599 Mon Sep 17 00:00:00 2001 From: Loek van Gool Date: Wed, 3 Apr 2024 12:13:01 +0200 Subject: [PATCH 2/3] Update Abstract.php --- .../Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 8cf4a33e160..2038e349fbb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -115,7 +115,7 @@ protected function _getInputValue(Varien_Object $row) /** * @return string */ - public function renderHeader(): string + public function renderHeader() { if ($this->getColumn()->getGrid()->getSortable() !== false && $this->getColumn()->getSortable() !== false) { $className = 'not-sort'; From a467e964a8952e3cf1d204ae486a91fdf6b376bc Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Thu, 4 Apr 2024 22:56:19 +0100 Subject: [PATCH 3/3] phpcs --- .../Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 2038e349fbb..968b6402a3d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -128,7 +128,7 @@ public function renderHeader() . '" class="' . $className . '">' . $this->escapeHtml($this->getColumn()->getHeader()) . ''; } else { - $out = ''.$this->escapeHtml($this->getColumn()->getHeader()) . ''; + $out = '' . $this->escapeHtml($this->getColumn()->getHeader()) . ''; } return $out; }