vanilophp / product

Product Module for Vanilo (or any Laravel app)
https://vanilo.io
MIT License
18 stars 8 forks source link

Error when trying to access isActive() method #12

Closed victorighalo closed 4 years ago

victorighalo commented 4 years ago

I get this error when i try to access isActive() method.

Return value of Konekt\Concord\Proxies\EnumProxy::targetClass() must be of the type string, null returned

fulopattila122 commented 4 years ago

How do you access the method? Do you use a custom model in your application? Do you use the component standalone or within the Vanilo Framework?

victorighalo commented 4 years ago

I used all approaches. Custom model, Vanillo model, standalone, framework, I downgraded, upgraded. Just same errors. On Aug 5, 2020 11:05 PM, Attila Fulop notifications@github.com wrote: How do you access the method? Do you use a custom model in your application? Do you use the component standalone or within the Vanilo Framework?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

fulopattila122 commented 4 years ago

Can you access other methods on the model? Did you customize the statuses of the product?

fulopattila122 commented 4 years ago

Also, which version of Vanilo are you using? 1.2?

victorighalo commented 4 years ago

Can you access other methods on the model? Did you customize the statuses of the product?

Yes, i can access other methods; i don't think i customised statuses. Is that possible?

victorighalo commented 4 years ago

Also, which version of Vanilo are you using? 1.2?

Yes, version 1.2. I also downgraded but the error remains.

fulopattila122 commented 4 years ago

Yes, customizing of statuses is possible: https://vanilo.io/docs/1.2/enums#customizing-enums

Can you please post here the output of the command:

php artisan concord:enums

?

victorighalo commented 4 years ago

Yes, customizing of statuses is possible: https://vanilo.io/docs/1.2/enums#customizing-enums

Can you please post here the output of the command:

php artisan concord:enums

?

+------------------+-------------------------------------------+----------------------------------------+
| Shorthand        | Contract                                  | Concrete                               |
+------------------+-------------------------------------------+----------------------------------------+
| address_type     | Konekt\Address\Contracts\AddressType      | Konekt\Address\Models\AddressType      |
| cart_state       | Vanilo\Cart\Contracts\CartState           | Vanilo\Cart\Models\CartState           |
| customer_type    | Konekt\Customer\Contracts\CustomerType    | Konekt\Customer\Models\CustomerType    |
| gender           | Konekt\Address\Contracts\Gender           | Konekt\Address\Models\Gender           |
| gravatar_default | Konekt\AppShell\Contracts\GravatarDefault | Konekt\AppShell\Models\GravatarDefault |
| name_order       | Konekt\Address\Contracts\NameOrder        | Konekt\Address\Models\NameOrder        |
| province_type    | Konekt\Address\Contracts\ProvinceType     | Konekt\Address\Models\ProvinceType     |
| user_type        | Konekt\User\Contracts\UserType            | Konekt\User\Models\UserType            |
+------------------+-------------------------------------------+----------------------------------------+
fulopattila122 commented 4 years ago

Product Status is missing as I expected. Can you post the contents of config/concord.php?

victorighalo commented 4 years ago

Product Status is missing as I expected. Can you post the contents of config/concord.php?

<?php

return [
    'modules' => [
        Konekt\AppShell\Providers\ModuleServiceProvider::class => [
            'ui' => [
                'name' => 'Vanilo',
                'url' => '/admin/product'
            ]
        ],
        Vanilo\Cart\Providers\ModuleServiceProvider::class
    ]
];
fulopattila122 commented 4 years ago

The product module hasn't been added.

You have to add it:

<?php

return [
    'modules' => [
        Konekt\AppShell\Providers\ModuleServiceProvider::class => [
            'ui' => [
                'name' => 'Vanilo',
                'url' => '/admin/product'
            ]
        ],
        Vanilo\Cart\Providers\ModuleServiceProvider::class,
        Vanilo\Product\Providers\ModuleServiceProvider::class // <- add this line
    ]
];
victorighalo commented 4 years ago

The product module hasn't been added.

You have to add it:

<?php

return [
    'modules' => [
        Konekt\AppShell\Providers\ModuleServiceProvider::class => [
            'ui' => [
                'name' => 'Vanilo',
                'url' => '/admin/product'
            ]
        ],
        Vanilo\Cart\Providers\ModuleServiceProvider::class,
        Vanilo\Product\Providers\ModuleServiceProvider::class // <- add this line
    ]
];

thanks... it works now. btw: why wasn't it there? did i miss something in the docs? is this necessary when using the standalone products module?

victorighalo commented 4 years ago

I also get the same error when i do this: $taxon->taxonomy. So i added:

Vanilo\Category\Providers\ModuleServiceProvider::class,
Vanilo\Properties\Providers\ModuleServiceProvider::class,

Can these be automatically discovered by the package?

fulopattila122 commented 4 years ago

Add Vanilo\Category\Providers\ModuleServiceProvider::class to concord.php. Basically, every Vanilo module must be added this way.

Concord v2.0 will be hooked with auto-discovery, currently, you have to do this. It's a one-time 5-second change ;)

victorighalo commented 4 years ago

Add Vanilo\Category\Providers\ModuleServiceProvider::class to concord.php. Basically, every Vanilo module must be added this way.

Concord v2.0 will be hooked with auto-discovery, currently, you have to do this. It's a one-time 5-second change ;)

Thanks. Issues with concord resolved.