fredbliss / contao4-randomarticle

2 stars 4 forks source link

Module class does not exist #5

Closed netzarbeiter closed 5 years ago

netzarbeiter commented 5 years ago

Contao 4.4.26 / contao4-randomarticle 2.1

Trying to display the module in the frontend end up with the following error message:

Module class "IntelligentSpark\RandomArticle\ModuleRandomArticle" (module "randomarticle") does not exist

xchs commented 5 years ago

I have got the same problem.

@intelligentspark Does this extension work with the current version of Contao 4.4.35?

I have tried to display some random articles on the website but apparently it doesn't work. The error message specified above by @netzarbeiter is logged in the system log.

I used the following default settings in the front end module and integrated the module via the page layout:

randomarticle

fritzmg commented 5 years ago

Do namespaced classes work with classmap autoloading? I am not sure.

All the classes should be moved away from the src/Resources/contao directory and instead be placed in the appropriate namespace in src/.

e.g. src/Resources/contao/modules/ModuleRandomArticle.php should be moved to src/FrontendModule/ModuleRandomArticle.php and its namespace should be changed to IntelligentSpark\RandomArticle\FrontendModule etc.

// ah, I see the problem now: https://github.com/intelligentspark/contao4-randomarticle/pull/8

xchs commented 5 years ago

After applying the fix https://github.com/intelligentspark/contao4-randomarticle/pull/8 I still get the same error logged in the system log:

Module class "IntelligentSpark\RandomArticle\ModuleRandomArticle" (module "randomarticle") does not exist

No random article is displayed either.

What else I did:

@netzarbeiter Does the fix from https://github.com/intelligentspark/contao4-randomarticle/pull/8 work for you?

fritzmg commented 5 years ago

@xchs it works for me. Have you required dev-master?

xchs commented 5 years ago

Sorry, my bad. I missed that. Thank you, @fritzmg