0
votes

I have had this problem as seen in the title in the past and I always resolved this issue by adding the psr-4 autoloader in the emconf and simply reactivate my extensions.

Now I'm facing the same problem:

Could not analyse class: maybe not loaded or no autoloader?

but I have set the autoloader correctly as always. This also happens in more than one Extension right now.. After deleting the php cache in the install tool und dump autoload and reactivating my extension, the error was gone for some time, a couple hours later its back again.. Therefore I think it must have something to do with temp files, but I can't figure out what it is exactly..

Does anyone have a solution? I have seen plenty of topics about this issue on stackoverflow, I used them in the past, but unfortunately none is working for me right now.

Important fact: This error is happening on my new server now. On my old server (with the same code in the extensions) this didn't occur and they worked fine.

Thanks in advance.

Edit: Vendornames etc. are set correctly and there are no errors in the syntax whatsoever. As I said, the extensions worked fine.

Edit2: I just found this changelog of Typo3:

https://docs.typo3.org/typo3cms/extensions/core/Changelog/8.4/Breaking-78222-ExtensionAutoloadInformationIsNowInTypo3confautoload.html

But there is no solution for the impact for none composer installations. Can someone provide one for me?

3

3 Answers

0
votes

When you use composer installation and you use extensions which are not installed via composer, you need to add the autoload information in the root composer.json of your project and then run composer dump-autoload. (ext_emconf.php dont works in composer mode?)

{
    ...
    "autoload": {
        "psr-4": {
            "Vendor\\ExtensionNameA\\": "public/typo3conf/ext/extension_name_a/Classes",
            "Vendor\\ExtensionNameB\\": "public/typo3conf/ext/extension_name_b/Classes"
        }
    }
}

A possible explanation for strange timing thing "works and later not". Maybe it has something to do with the red clear cache button in the TYPO3 backend (Clear all caches). Maybe it start not working when u hit this button and cache files get cleared. Then you need to reinstall extensions to get the autoloader "temporarly" working, till the point you hit the clear all caches button again. With the solution i mentioned above, it works permanet.

0
votes

Have you left any configuration in your ext_tables.php?

As the TCA configuration, which is cached, is expected in Configuration/TCA/[Override/] any code in ext_tables.php might get lost.

If you want some configuration to be executed for each run you need to put it in ext_localconf.php

0
votes

Thanks for all the help, I found the solution myself now.

Actually it was not really caused by any autoloader configuration, but and old version of fpdf which apparently caused two extensions to not load their classes properly. The exception thrown was simply misleading. I have upgraded the version of fpdf and now it works properly. It is not clear to me why the same code worked a week ago and now it failed, but atleast I have found the solution to my problem.