Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module class does not exist #5

Closed
netzarbeiter opened this issue Oct 12, 2018 · 5 comments · Fixed by #8
Closed

Module class does not exist #5

netzarbeiter opened this issue Oct 12, 2018 · 5 comments · Fixed by #8

Comments

@netzarbeiter
Copy link

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
Copy link

xchs commented Mar 6, 2019

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
Copy link
Contributor

fritzmg commented Mar 15, 2019

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: #8

@xchs
Copy link

xchs commented Mar 15, 2019

After applying the fix #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:

  • rebuilt the cache via Contao Manager
  • deleted manually the folder var/cache
  • created a new front end module "Random article"

@netzarbeiter Does the fix from #8 work for you?

@fritzmg
Copy link
Contributor

fritzmg commented Mar 16, 2019

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

@xchs
Copy link

xchs commented Mar 16, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants