0

I created a module, which I later deleted. The homepage of my site loads, and my categories page loads, but my products pages don't load.

I get an error saying

1 exception(s):
Exception #0 (ReflectionException): Class Company\Modulename\Model\Product\Attribute\FileUpload does not exist

That module doesn't exist. I've searched the entire project, and nothing that looks like that class exists.

I've delete var/viewpreprocessed, var/cache, var/page_cache, pub/static/frontend, pub/static/adminhtml, generated.

I've run setup/upgrade, setup:di:compile, setup:static-content:deploy -f, and c:c/c:f multiple times, and removed the record of the module from the db entirely, but it's changed nothing

Any other ideas?

Thanks

2 Answers 2

2

If you have kept the module before deleting it, you may check the folder Setup within the module root folder.

If the module installs anything in the database, it may have created attribute in the database (this is quite common) and these attributes would point onto Models that might have disappeared.

you would need to delete (manually is possible) these new attributes. Do keep a backup of the database before doing this of course

4
  • @Toan Tam a lot of those directories don't exist anymore, but even so, that didn't work.
    – web master
    Jun 23, 2020 at 12:35
  • That's probably it. It did add an EAV attribute. I'll look for it and delete it.
    – web master
    Jun 23, 2020 at 12:35
  • Herve, This helped me. Thanks! For those still investigating, if you query the eav_attribute table in your database you can sort or filter by source_model and see the offending class that is being called, but doesn't exist. You delete these attributes through the admin Stores > Attributes > Product page and that's it. You don't even have to re-compile.
    – Jon
    Feb 15 at 19:58
  • thanks for this feedback @jon. You are right, using this table eav_attribute is the one to query. Your idea to handle the change from the backend is also useful for those who are not technical Feb 19 at 8:48
0

Sometimes, I have this kind of issue. And I was able to fix it by running composer dump-autoload.

Can you try to run the following commands?

composer dump-autoload
rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/di/ generated/* var/generation/*
2
  • what does "composer dump-autoload" do ?
    – devmage
    Jun 23, 2020 at 5:35
  • 1
    It regenerates the list of classes that need to be included in the project.
    – Toan Tam
    Jun 23, 2020 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.