0

In magento2, admin for category selector field does not saved a value in db

sales_rule_form.xml

<field name="category_ids">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">240</item>
                <item name="dataType" xsi:type="string">select</item>
                <item name="formElement" xsi:type="string">multiselect</item>
                <item name="label" xsi:type="string" translate="true">Categories</item>
                <item name="breakLine" xsi:type="boolean">true</item>
                <item name="component" xsi:type="string">Magento_Catalog/js/components/new-category</item>
                <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                <item name="filterOptions" xsi:type="boolean">true</item>
                <item name="showCheckbox" xsi:type="boolean">true</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
                <item name="multiple" xsi:type="boolean">true</item>                
                <item name="visibleValue" xsi:type="string">2</item>
                <item name="visible" xsi:type="boolean">false</item>  
                <item name="listens" xsi:type="array">
                     <item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
                </item>  
            </item>
        </argument>
    </field>

Can't save a categories

enter image description here enter image description here

Error: main.CRITICAL: exception 'Exception' with message 'Notice: Array to string conversion'

  • Can you please add your code for save controller? – Ankita Patel Sep 26 at 12:59

Your Answer

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

Browse other questions tagged or ask your own question.