Search code examples
cookiestypo3typo3-extensionstypo3-10.x

sg-cookie-optin extension throws No class named SGalinski\SgCookieOptin\Hook\LicenceCheckHook


Downloaded this https://packagist.org/packages/sgalinski/sg-cookie-optin

Copied the file to the server, activated the extension in ext manager. Suddenly front & backend not working anymore.

Deleted the extension manually from PackageStates.php according to https://docs.typo3.org/m/typo3/guide-installation/master/en-us/ExtensionInstallation/Index.html

Frontend now working, backend still throws the error

No class named SGalinski\SgCookieOptin\Hook\LicenceCheckHook

    in /home/sc/wwn/typo3_src-10.4.10/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 3340
                        throw new \InvalidArgumentException($errorMsg, 1294585865);
                    }
                } else {
                    $errorMsg = 'No class named ' . $parts[0];
                    throw new \InvalidArgumentException($errorMsg, 1294585866);
                }
            } elseif (function_exists($funcName) && is_callable($funcName)) {
                // It's a function
                $content = call_user_func_array($funcName, [&$params, &$ref]);

I did set up the key and the output folder in the config file what I didn't do since backend not working anymore :

3. Add the static TypoScript named "Cookie Optin" to your instance with the "Template" backend module. Open up the "Template" module in the backend of TYPO3. Go to your root site page within the page tree. Choose "Info/Modify" at the select on the top. Click on the button "Edit the whole template record". Select the tab "Includes". Choose the template "Cookie Optin (sg_cookie_optin)" on the multi select box with the name "Include static (from extensions)" Save 4. Go into the "Cookie Opt In" backend module, configure it and save it once.

Any idea how i can fix that? Pretty stuck atm.


Solution

  • The install tool of your installation should still work. Try to open yourdomain.tld/typo3/install.php.

    To enable the Install Tool, the file ENABLE_INSTALL_TOOL must be created in the directory typo3conf/. Make sure that the file has no file extension like .txt.

    Then log in to the install tool and go to Maintenance => Flush TYPO3 and PHP Cache and flush all caches.

    Then the backend should work.

    If the install tool is not accessible, try to find a folder var/Cache. Most probably it will be located in typo3temp. Delete all files and subfolders from the Cache folder.