skaparate / prestashop-sample-module

Shows how to override a symfony route in PrestaShop
6 stars 3 forks source link

Got error: The controller for URI "/sell/orders/" is not callable. Class "Skaparate\Controller\Admin\CustomOrdersController" does not exist. #1

Open Bugfunder opened 3 years ago

Bugfunder commented 3 years ago

Any idea how to resolve / debug it?

skaparate commented 3 years ago

Hello!

If you cloned the project, instead of using the release, Did you run composer install first? It's required so the autoloader is generated (there needs to be a vendor folder on the project).

Bugfunder commented 3 years ago

No, did not run it (was not written in your readme). In which folder should I run it?

вт, 29 черв. 2021 о 14:40 skaparate @.***> пише:

Hello!

Did you run composer install first? It's required so the autoloader is generated (there needs to be a vendor folder on the project).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-870564372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNELIIJZZFCMA2JCRXPDTVG5KLANCNFSM47P4JTGA .

skaparate commented 3 years ago

If you cloned the repository, then in the root of the module, under PrestaShop/modules/sk_test:

cd path_to_prestashop/modules/sk_test
composer install

If you used the release zip, then it should work out of the box.

Bugfunder commented 3 years ago

Yes, I installed it and got it writing Hello World.

Can you point out where your release zip is?

Because in my case

composer install

generated lots of files in vendor folder, and I wonder if they are all needed.

вт, 29 черв. 2021 о 14:48 skaparate @.***> пише:

If you cloned the repository, then in the root of the module, under PrestaShop/modules/sk_test:

cd path_to_prestashop/modules/sk_test composer install

If you used the release zip, then it should work out of the box.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-870569977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNELLEOYZUDIDJDOQZDTTVG6KZANCNFSM47P4JTGA .

skaparate commented 3 years ago

It's under the releases of the repository.

To understand what composer does, please refer to the documentation.

skaparate commented 3 years ago

By the way, the "require-dev" of the composer file are just utilities to help you develop the module and are not really required (you may replace or remove them)

Bugfunder commented 3 years ago

Thanks, in my case composer install generates lots of folders in vendor:

autoload.php bin composer doctrine friendsofphp myclabs nikic phar-io php-cs-fixer phpdocumentor phpspec phpunit prestashop psr sebastian squizlabs symfony theseer webmozart

Perhaps it has to do with my installation of composer. Will give a try to your release zip instead.

вт, 29 черв. 2021 о 21:45 skaparate @.***> пише:

By the way, the "require-dev" of the composer file are just utilities to help you develop the module and are not really required (you may replace or remove them)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-870866812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNEO3G7MY2S6NSAKCNRLTVIPFRANCNFSM47P4JTGA .

Bugfunder commented 3 years ago

Now I get a different problem. When I go to Orders/Orders for the first time, I get " Hello world! ", as intended.

When I do it for the next time, I get Page not found The controller AdminOrders is missing or invalid. So apparently it tries to load the old (legacy) controller.

ср, 30 черв. 2021 о 09:31 Yarick @.***> пише:

Thanks, in my case composer install generates lots of folders in vendor:

autoload.php bin composer doctrine friendsofphp myclabs nikic phar-io php-cs-fixer phpdocumentor phpspec phpunit prestashop psr sebastian squizlabs symfony theseer webmozart

Perhaps it has to do with my installation of composer. Will give a try to your release zip instead.

вт, 29 черв. 2021 о 21:45 skaparate @.***> пише:

By the way, the "require-dev" of the composer file are just utilities to help you develop the module and are not really required (you may replace or remove them)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-870866812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNEO3G7MY2S6NSAKCNRLTVIPFRANCNFSM47P4JTGA .

skaparate commented 3 years ago

Thanks, in my case composer install generates lots of folders in vendor: autoload.php bin composer doctrine friendsofphp myclabs nikic phar-io php-cs-fixer phpdocumentor phpspec phpunit prestashop psr sebastian squizlabs symfony theseer webmozart

Don't worry, that's OK. Those are the dependencies (and the dependencies between) used on the "require-dev" of the composer.json file. Remove all the "required-dev" if you like.

When I do it for the next time, I get Page not found The controller AdminOrders is missing or invalid. So apparently it tries to load the old (legacy) controller.

That's something I didn't test for :stuck_out_tongue:. If you can wait, I'll review it in a couple of weeks (I have another job right now), otherwise you will have to try it on your own, sorry :sweat:. Regardless, I thank you for letting me know :smiley:.

Bugfunder commented 3 years ago

Yes, I can wait, no problem. Currently put my controller under PrestashopBundle.

BTW, in the official documentation there is nothing about composer stuff.

ср, 30 черв. 2021 о 18:15 skaparate @.***> пише:

Thanks, in my case composer install generates lots of folders in vendor: autoload.php bin composer doctrine friendsofphp myclabs nikic phar-io php-cs-fixer phpdocumentor phpspec phpunit prestashop psr sebastian squizlabs symfony theseer webmozart

Don't worry, that's OK. Those are the dependencies (and the dependencies between) used on the "require-dev" of the composer.json file. Remove all the "required-dev" if you like.

When I do it for the next time, I get Page not found The controller AdminOrders is missing or invalid. So apparently it tries to load the old (legacy) controller.

That's something I didn't test for 😛. If you can wait, I'll review it in a couple of weeks (I have another job right now), otherwise you will have to try it on your own, sorry 😓. Regardless, I thank you for letting me know 😃.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-871540396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNEITC2G52HMWSWWPEP3TVM7JTANCNFSM47P4JTGA .

skaparate commented 3 years ago

Currently put my controller under PrestashopBundle.

You mean you put it directly under path_to_prestashop/src/PrestaShopBundle? If so, there's a chance that when you update PrestaShop your controller will be replaced/removed.

BTW, in the official documentation there is nothing about composer stuff

It's mentioned here: https://devdocs.prestashop.com/1.7/modules/concepts/composer/#composer

Remember that this is just a sample and not meant to serve as a rule for everyone. If you don't want to use composer on your project, switch it to another dependency manager or remove it (if you know what you're doing) 😃.

Bugfunder commented 3 years ago

I just wish it works without any dependency manager other than the standard one used in Prestashop. The twig template works without it, and also the page

https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/override-decorate-controller/

does not mention the need to use composer.

As I do updates via git, I do not think they can remove my controller.

ср, 30 черв. 2021 о 22:36 skaparate @.***> пише:

Currently put my controller under PrestashopBundle.

You mean you put it directly under path_to_prestashop/src/PrestaShopBundle? If so, there's a change that when you update PrestaShop your controller will be replaced/removed.

BTW, in the official documentation there is nothing about composer stuff

It's mentioned here: https://devdocs.prestashop.com/1.7/modules/concepts/composer/#composer

Remember that this is just a sample and not meant to serve as a rule for everyone. If you don't want to use composer on your project, switch it to another dependency manager or remove it (if you know what you're doing) 😃 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-871710688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNEMUTXDUWRS52MA32D3TVN56BANCNFSM47P4JTGA .

skaparate commented 3 years ago

I just wish it works without any dependency manager other than the standard one used in Prestashop. The twig template works without it, and also the page

https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/override-decorate-controller/

does not mention the need to use composer.

Like I said, you can simply remove it and adapt it however you like :)

Bugfunder commented 3 years ago

Yeah, but the problem is that it does not work without..

чт, 1 лип. 2021 о 00:07 skaparate @.***> пише:

I just wish it works without any dependency manager other than the standard one used in Prestashop. The twig template works without it, and also the page

https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/override-decorate-controller/

does not mention the need to use composer.

Like I said, you can simply remove it and adapt it however you like :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skaparate/prestashop-sample-module/issues/1#issuecomment-871758442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2RNEO2IGY5HTHRGVSBMJDTVOISJANCNFSM47P4JTGA .