0

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?

3

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 Jan 3 at 10:05
  • @jibingeorge Yes. It seems it is case sensitive. – Lez Jan 3 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.