staempfli / magento2-code-generator

Code generator for Magento 2
250 stars 58 forks source link

Crud - Not registered handle Error #8

Closed nei closed 7 years ago

nei commented 7 years ago

Just installed your generator and created a new crud.

When I go to index page I get the error message

Not registered handle neei_module_type_listing_data_source

I've tried twice just in case I've missed something. Any idea?

jalogut commented 7 years ago

Hi @nei ,

I am glad you are using our tool. I have tried to reproduce the issue but it works for me. Could you provide us more info?

Attached you will find a screenshot with the steps I followed to create the crud module and also a .zip file with the code generated. You could maybe compare that with yours and see if you find any differences. crud_test Neei.zip

nei commented 7 years ago

yes quite useful tool @jalogut I will do it.

nei commented 7 years ago

magento EE 2.1.3 mg2-codegen 1.6.4

Still getting the same issue.

Not registered handle neei_catalogue_type_listing_data_source

{10:40}~/src/project:feature/DT-144 ✗ ➭ cd app/code/
{10:40}~/src/project/app/code:feature/DT-144 ✗ ➭ mkdir Neei
{10:40}~/src/project/app/code:feature/DT-144 ✗ ➭ cd Neei
{10:40}~/src/project/app/code/Neei:feature/DT-144 ✗ ➭ mkdir Catalogue
{10:40}~/src/project/app/code/Neei:feature/DT-144 ✗ ➭ cd Catalogue
{10:40}~/src/project/app/code/Neei/Catalogue:feature/DT-144 ✗ ➭ /usr/local/bin/mg2-codegen t:g module
Template Generate: module
 --------------------- -----------
  property              value
 --------------------- -----------
  CommentsCompanyName   Neei
  commentsCompanyName   Neei
  CommentsYear          2017
  commentsYear          2017
 --------------------- -----------

 vendorname:
 > Neei

 modulename:
 > Catalogue

 description:
 > Test

 Code will be generated at following path /Users/neisantos/src/project/app/code/Neei/Catalogue

 Do you want to continue? (yes/no) [yes]:
 > yes

File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/composer.json
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/etc/module.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/registration.php

 [OK] CODE GENERATED!

{10:41}~/src/project/app/code/Neei/Catalogue:feature/DT-144 ✗ ➭ /usr/local/bin/mg2-codegen t:g crud
Template Generate: crud
 --------------------- -----------
  property              value
 --------------------- -----------
  CommentsYear          2017
  commentsYear          2017
 --------------------- -----------

 Entityname:
 > Type

 Code will be generated at following path /Users/neisantos/src/project/app/code/Neei/Catalogue

 Do you want to continue? (yes/no) [yes]:
 > yes

File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Model/Type.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Model/ResourceModel/Type/Collection.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Model/ResourceModel/Type.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Setup/InstallSchema.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Setup/Uninstall.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Block/Adminhtml/Type/Edit/BackButton.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Block/Adminhtml/Type/Edit/DeleteButton.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Block/Adminhtml/Type/Edit/SaveAndContinueButton.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Block/Adminhtml/Type/Edit/SaveButton.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/Delete.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/Edit.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/Index.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/InlineEdit.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/MassDelete.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/Save.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Controller/Adminhtml/Type/Validate.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Model/ResourceModel/Type/Grid/Collection.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Ui/Component/Form/Type/DataProvider.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/Ui/Component/Listing/Column/TypeActions.php
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/etc/acl.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/etc/adminhtml/menu.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/etc/adminhtml/routes.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/etc/di.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/view/adminhtml/layout/neei_catalogue_type_edit.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/view/adminhtml/layout/neei_catalogue_type_index.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/view/adminhtml/ui_component/neei_catalogue_type_form.xml
File Created: /Users/neisantos/src/project/app/code/Neei/Catalogue/view/adminhtml/ui_component/neei_catalogue_type_listing.xml

 ! [NOTE] This template needs you to take care of the following manual steps:

 1. Add your custom fields on:

    Neei/Catalogue/Setup/InstallSchema.php

2. Add your custom columns to the grid

    Neei/Catalogue/view/adminhtml/ui_component/neei_catalogue_type_listing.xml

3. Add your custom fields to the form

    Neei/Catalogue/view/adminhtml/ui_component/neei_catalogue_type_form.xml

4. Set the Admin Menu tab where you want your Module can be found:

    Neei/Catalogue/etc/adminhtml/menu.xml

5. Set From server side Validations:

    Neei\Catalogue\Controller\Adminhtml\Type\Validate:

    /**
     * Check if required fields is not empty
     *
     * @param array $data
     */
    public function validateRequireEntries(array $data)
    {
        $requiredFields = [
            'identifier' => __('Type Identifier'),
        ];

        //...

 [OK] CODE GENERATED!

{10:41}~/src/project/app/code/Neei/Catalogue:feature/DT-144 ✗ ➭
{10:42}~/src/project/app/code/Neei/Catalogue:feature/DT-144 ✗ ➭ php bin/magento setup:upgrade
Could not open input file: bin/magento
{10:42}~/src/project/app/code/Neei/Catalogue:feature/DT-144 ✗ ➭ cd ..
{10:42}~/src/project/app/code/Neei:feature/DT-144 ✗ ➭ cd ..
{10:42}~/src/project/app/code:feature/DT-144 ✗ ➭ cd ..
{10:42}~/src/project/app:feature/DT-144 ✗ ➭ cd ..
{10:42}~/src/project:feature/DT-144 ✗ ➭ php bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
......
Please re-run Magento compile command

The logs I have just that:

[2017-06-02 09:49:39] report.CRITICAL: Broken reference: the 'header' tries to reorder itself towards 'global.notices', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-06-02 09:49:39] report.CRITICAL: Broken reference: the 'page.breadcrumbs' tries to reorder itself towards 'notifications', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-06-02 09:49:39] report.CRITICAL: Broken reference: the 'global.search' tries to reorder itself towards 'notification.messages', but their parents are different: 'header.inner.right' and 'header' respectively. [] []
[2017-06-02 09:49:39] report.CRITICAL: Not registered handle neei_catalogue_type_listing_data_source [] []

screenshot

jalogut commented 7 years ago

Hi @nei,

Sorry for the delay in my reply. Did you manage to fix the issue? I noticed that you are using Enterprise. Although it should be the same for CE and EE, I can only test it on Community. I have tested it on CE 2.1.3 and it works for me. Did you try the .zip I attached in my previous comment? If you want, you could also send me your generated code and I will check if I can find something.

nei commented 7 years ago

Hi @jalogut

It may be an invalid issue. It seems the problem was actually related with another custom module that had the di.xml inside the adminhtml folder and it was overwritten stuff. thank you for your help and sorry for the noisy.