The goal is to get a drop down list of stores the site has. The current implementation is attempting to add the following into a ui_component xml file around line 100.
<field name="store_id">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">Magento\Store\Ui\Component\Listing\Column\Store</item>
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Store</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">text</item>
<item name="formElement" xsi:type="string">select</item>
</item>
</argument>
</field>
However, when visit the adminhtml section, I get an error message stating that now the type is not an array at line 57. Which happens to be the following:
<fieldset name="general">
<argument name="data" xsi:type="array">
Does anyone know the proper way to implement this or have similar examples they could point me to?
Error:
Warning: array_values() expects parameter 1 to be array, object given in WEB_ROOT/vendor/magento/module-ui/Component/Form/Element/AbstractOptionsField.php on line 57
Note: The error goes away when I remove the field store_id.
Magento\Store\Ui\Component\Listing\Column\Store
is supposed to be used for Listing component. So the easiest way to resolve it is to create your own option source that fetches the stores in your website. check below answer.