-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem
In the form layout xml file, when the options are set for a field as shown in the example,
<item name="is_active" xsi:type="array">
<item name="field_type" xsi:type="string">select</item>
<item name="sort_order" xsi:type="number">1</item>
<item name="options" xsi:type="string">Magento\Config\Model\Config\Source\Yesno</item>
</item>
getting an error in the frontend like:
$options is not a proper instance: string
When I tried below:
<item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
getting a different error in that case:
Instance of Magento\Framework\View\Element\Block\ArgumentInterface is expected, got Magento\Config\Model\Config\Source\Yesno instead.
Technical Details
Error is thrown from view/adminhtml/templates/form/field_type/select.phtml
$options = $field->getOptions();
...
if (false === $options instanceof OptionSourceInterface) {
echo '$options is not a proper instance: '.gettype($options);
return;
}
It seems $options is not resolved here.
Metadata
Metadata
Assignees
Labels
No labels