cancel
Showing results for 
Search instead for 
Did you mean: 

Error: The configuration parameter "formElement" is a required for "costum_attribute" field.

Error: The configuration parameter "formElement" is a required for "costum_attribute" field.

I am trying to update a new custom boolean attribute for my products. I made a csv file with "additional attributes" column value like below:

disable_purchase=0,product_image_size=Default,sw_featured=No

disable_purchase=1,product_image_size=Default,sw_featured=No

 

I import this csv by using the magento default method, and everything looks fine, no error message. 

 

However, when I go back to the catalog, I can't edit any of the product, when I click into a product, an error page occur with the following message:

---------------------------

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 424900644562

----------------------------

Then I checked the error report, find the following information:

 

a:4:{i:0;s:85:"The configuration parameter "formElement" is a required for "disable_purchase" field.";i:1;s:7643:"#0 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(148): Magento\Ui\Component\Form\Field->prepare()
#1 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Form\Field))
#2 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Container))
#3 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Form\Fieldset))
#4 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(126): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Form))
#5 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'product_form', Array, Object(Magento\Framework\View\Layout\Interceptor))
#6 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#7 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#8 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout->generateElements()
#9 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#10 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#11 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#12 /home/kuohua/public_html/online-store/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#13 /home/kuohua/public_html/online-store/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout->getBlock('menu')
#14 /home/kuohua/public_html/online-store/vendor/magento/module-catalog/Controller/Adminhtml/Product/Edit.php(69): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...')
#15 /home/kuohua/public_html/online-store/vendor/magento/framework/App/Action/Action.php(102): Magento\Catalog\Controller\Adminhtml\Product\Edit->execute()
#16 /home/kuohua/public_html/online-store/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#17 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#18 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->___callParent('dispatch', Array)
#19 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Array, 'adminAuthentica...')
#20 /home/kuohua/public_html/online-store/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#21 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#22 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Array, 'adminMassaction...')
#23 /home/kuohua/public_html/online-store/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#24 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#25 /home/kuohua/public_html/online-store/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Edit/Interceptor.php(26): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->___callPlugins('dispatch', Array, Array)
#26 /home/kuohua/public_html/online-store/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#27 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#28 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#29 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#30 /home/kuohua/public_html/online-store/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#31 /home/kuohua/public_html/online-store/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#32 /home/kuohua/public_html/online-store/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#33 /home/kuohua/public_html/online-store/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#34 /home/kuohua/public_html/online-store/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#35 /home/kuohua/public_html/online-store/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#36 {main}";s:3:"url";s:122:"/online-store/kuohua_admin/catalog/product/edit/id/4/key/6660e84cbf8a6d0ab710febc06cdb1c9e9fdc4e29cfb60cecfe29e815765d3bc/";s:11:"script_name";s:23:"/online-store/index.php";}

 

Anyone knows how to solve this?

 

 

3 REPLIES 3

Re: Error: The configuration parameter "formElement" is a required for "costum_attrib

Please share if you have a solution. I too received this error:

 

Exception #0 (Magento\Framework\Exception\LocalizedException): The "formElement" configuration parameter is required for the "brand" field.

I received this error after I created a module that created a custom attribute programatically.

Re: Error: The configuration parameter "formElement" is a required for "costum_attrib

Hi @BruceGemberling  @quizmask  Go to Product attribute and change theValues Required to No. as mentioned in the screenshot link https://prnt.sc/odep04

 

it might be the case that you are imporing values for your custom attribute in the recent import but the attribute is now associated with your old products as well which don't have this attribute value, and we set it as required. So either removed required value or export all products and set the value to that attribute for all products and reimport.

 

Also there might be one more case, the value you are assiging to your attribute in csv file is incorrect. So for that try adding the value to that product from admin. Export the csv notice what it is showing 1 or Yes based on that fill the Csv and reupload.

 

Hope this helps.

Re: Error: The configuration parameter "formElement" is a required for "costum_attrib

Hi @BruceGemberling,

 

You are missing this below argument, in your ui_component, since its a required field so it needs to be set up.

<item name="formElement" xsi:type="string">select</item>

 For e.g, if you are creating a custom category attribute and you want that to be visible in the category form, in the view/adminhtml/ui_component/category_form.xml

<field name="color">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="required" xsi:type="boolean">false</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">false</item>
</item>
<item name="sortOrder" xsi:type="number">50</item>
<item name="dataType" xsi:type="string">string</item>
<item name="formElement" xsi:type="string">select</item>
<item name="label" translate="true" xsi:type="string">Color</item>
</item>
</argument>
</field>

The strike-out part is actually missing from you configuration.