Skip to content

Commit

Permalink
Patch Release : Merge pull request #418 from helloextend/fix_system_xml
Browse files Browse the repository at this point in the history
Patch Release : fixed read only field in system settings
  • Loading branch information
jm-extend authored Sep 5, 2024
2 parents b257fce + b1e2ba7 commit 7099d6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 15 additions & 0 deletions Block/System/Config/Field/Readonlyfield.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Extend\Warranty\Block\System\Config\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Config\Block\System\Config\Form\Field;

class ReadonlyField extends Field
{
protected function _getElementHtml(AbstractElement $element)
{
$element->setData('readonly', 'readonly');
return $element->getElementHtml();
}
}
7 changes: 4 additions & 3 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@
</comment>
<depends>
<field id="warranty/authentication/auth_mode">1</field>
</depends>
<disabled>1</disabled>
</depends>
<frontend_model>Extend\Warranty\Block\System\Config\Field\Readonlyfield</frontend_model>
</field>
<field id="client_id"
translate="label comment"
Expand Down Expand Up @@ -297,7 +297,8 @@
</comment>
<depends>
<field id="warranty/authentication/auth_mode">0</field>
</depends>
</depends>
<frontend_model>Extend\Warranty\Block\System\Config\Field\Readonlyfield</frontend_model>
</field>
<field id="sandbox_client_id"
translate="label comment"
Expand Down

0 comments on commit 7099d6c

Please sign in to comment.