Skip to content

Commit 74f1671

Browse files
committed
Changed function because ReadOnly Class can not be used in PHP8.1
1 parent d32f259 commit 74f1671

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?php
2-
namespace Experius\Postcode\Block\System\Config\Form\Field;
3-
4-
use Magento\Framework\Data\Form\Element\AbstractElement;
5-
6-
class ReadOnly extends \Magento\Config\Block\System\Config\Form\Field
7-
{
8-
protected function _getElementHtml(AbstractElement $element)
9-
{
10-
$element->setData('readonly', 1);
11-
return $element->getElementHtml();
12-
}
13-
}
1+
<?php
2+
namespace Experius\Postcode\Block\System\Config\Form\Field;
3+
4+
use Magento\Framework\Data\Form\Element\AbstractElement;
5+
6+
class ReadOnlyField extends \Magento\Config\Block\System\Config\Form\Field
7+
{
8+
protected function _getElementHtml(AbstractElement $element)
9+
{
10+
$element->setData('readonly', 1);
11+
return $element->getElementHtml();
12+
}
13+
}

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</field>
2323
<field id="api_key_is_valid" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="40" translate="label" type="text">
2424
<label>Api Key is valid</label>
25-
<frontend_model>Experius\Postcode\Block\System\Config\Form\Field\ReadOnly</frontend_model>
25+
<frontend_model>Experius\Postcode\Block\System\Config\Form\Field\ReadOnlyField</frontend_model>
2626
</field>
2727
<field id="api_key_checker" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="41" translate="label" type="button">
2828
<button_label>Check Api Key</button_label>

0 commit comments

Comments
 (0)