I'm getting this error when going to a custom extension's (IWD_Opc) admin configuration page.
Undefined index: label in .../vendor/magento/framework/Data/Form/Element/Select.php on line 68
Any ideas what this error means or how to go about fixing it?
Using Magento 2.2.2.
This seems to be connected with /etc/adminhtml/system.xml with one of the fields, still not sure which one or why this is happening...
EDIT
It's connected with a new custom payment method and the system config field:
<field id="default_payment_method" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Default Payment Method</label>
<source_model>IWD\Opc\Model\Config\Source\Payment</source_model>
</field>
Model code is:
use Magento\Payment\Model\Config\Source\Allmethods;
class Payment extends Allmethods
{
public function toOptionArray()
{
$options = parent::toOptionArray();
array_unshift($options, ['value' => '', 'label' => '-- Please select a payment method --']);
return $options;
}
}
So I presume that my custom payment method is not registered properly to be included in the Allmethods class?
1 Answer 1
Was just a typo in my custom payment method's /etc/config.xml
<group>Offline</group>
Should be
<group>offline</group>
-
the capital letter was the issue?jibin george– jibin george2020年01月03日 10:05:53 +00:00Commented Jan 3, 2020 at 10:05
-
@jibingeorge Yes. It seems it is case sensitive.Lez– Lez2020年01月03日 11:46:49 +00:00Commented Jan 3, 2020 at 11:46
-
Thanks @Lez, You saved my day. !Sameer Bhayani– Sameer Bhayani2022年07月05日 13:48:41 +00:00Commented Jul 5, 2022 at 13:48
Explore related questions
See similar questions with these tags.