0

I'm new to Magento, my version is 2.3, i'm getting this error when i open form view: Not registered handle event_form_data_source, i made my custom module Plumtree_Events, here are my files code.

/app/code/Plumtree/Events/etc/di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="event_listing_data_source" xsi:type="string">Plumtree\Events\Model\ResourceModel\Event\Collection</item>
            </argument>
        </arguments>
    </type>

    <virtualType name="Plumtree\Events\Model\ResourceModel\Event\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">plumtree_events</argument>
            <argument name="resourceModel" xsi:type="string">Plumtree\Events\Model\ResourceModel\Event</argument>
        </arguments>
    </virtualType>
</config>

/app/code/Plumtree/Events/view/adminhtml/layout/event_event_newaction.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="event_event_edit"/>
    <body/>
</page>

/app/code/Plumtree/Events/view/adminhtml/layout/event_event_edit.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="styles"/>
    <update handle="editor"/>
    <body>
        <referenceContainer name="content">
            <uiComponent name="event_form"/>
        </referenceContainer>
    </body>
</page>

/app/code/Plumtree/Events/view/adminhtml/ui_component/event_form.xml

<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">event_form.event_form_data_source</item>
            <item name="deps" xsi:type="string">event_form.event_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">Event Form</item>
        <item name="layout" xsi:type="array">
            <item name="type" xsi:type="string">tabs</item>
        </item>
    </argument>

    <dataSource name="event_form_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument>
            <argument name="name" xsi:type="string">event_form_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">events_id</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
    </dataSource>

    <fieldset name="event">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Event Fieldset</item>
            </item>
        </argument>

        <!-- This field represents form id and is hidden -->
        <field name="events_id" formElement="input">
         ...........
        </field>
    </fieldset>
</form>

0

You should update your code:

<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">event_form.event_listing_data_source</item>
        <item name="deps" xsi:type="string">event_form.event_listing_data_source</item>
    </item>
    <item name="label" xsi:type="string" translate="true">Event Form</item>
    <item name="layout" xsi:type="array">
        <item name="type" xsi:type="string">tabs</item>
    </item>
</argument>

<dataSource name="event_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument>
        <argument name="name" xsi:type="string">event_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">events_id</argument>
        <argument name="requestFieldName" xsi:type="string">id</argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
        </item>
    </argument>
</dataSource>

Please check.

  • Thank for mark as right answer. :) – Ravi Soni Jun 27 '19 at 17:39
  • can you please explain it. – Ali Raza Jan 29 at 9:26

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.