heimrichhannot / contao-slick-bundle

A content slider/carousel for contao based on kenwheelers slick carousel.
3 stars 3 forks source link

Contao 4.13: Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace? #58

Closed TorCoGit closed 2 years ago

TorCoGit commented 2 years ago

Context Contao version: 4.13 Bundle version: 1.01 PHP version: 7.4.25

Description I integrated the slick slider on my homepage. After updating to contao 4.13 the FE still works but when I try to edit the article homepage the following error occurs: Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace?

This ist written in the error log: [2022-03-07T10:44:21.319540+01:00] request.INFO: Matched route "contao_backend". {"route":"contao_backend","route_parameters":{"_route":"contao_backend","_scope":"backend","_token_check":true,"_controller":"Contao\\CoreBundle\\Controller\\BackendController::mainAction"},"request_uri":"https://XXXXX.de/contao?do=article&id=XXXXX&ref=XXXXX&rt=XXXXX&table=tl_content","method":"GET"} [] [2022-03-07T10:44:21.515957+01:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace?" at /XXXXX/vendor/heimrichhannot/contao-slick-bundle/src/Module/ModuleSlickNewsList.php line 28 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\ClassNotFoundError(code: 0): Attempted to load class \"Utf8\" from namespace \"Patchwork\".\nDid you forget a \"use\" statement for another namespace? at /XXXXX/vendor/heimrichhannot/contao-slick-bundle/src/Module/ModuleSlickNewsList.php:28)"} []

In the debug mode there ist this stack trace: `Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace?

at vendor/heimrichhannot/contao-slick-bundle/src/Module/ModuleSlickNewsList.php:28 at HeimrichHannot\SlickBundle\ModuleSlickNewsList->generate() (vendor/contao/core-bundle/src/Resources/contao/elements/ContentModule.php:100) at Contao\ContentModule->generate() (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:612) at Contao\Controller::getContentElement() (vendor/contao/core-bundle/src/Resources/contao/dca/tl_content.php:1342) at tl_content->addCteType() (vendor/erdmannfreunde/euf_grid/classes/tl_content_extended.php:20) at tl_content_extended->addCteType() (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:4623) at Contao\DC_Table->parentView() (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:315) at Contao\DC_Table->showAll() (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:655) at Contao\Backend->getBackendModule() (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:170) at Contao\BackendMain->run() (vendor/contao/core-bundle/src/Controller/BackendController.php:49) at Contao\CoreBundle\Controller\BackendController->mainAction() (vendor/symfony/http-kernel/HttpKernel.php:152) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (web/index.php:44)`

koertho commented 2 years ago

Ok, there is a missing require in the composer.json, as contao removed the patchwork/ut8 deprendency. As workarount, you could add patchwork/utf (https://packagist.org/packages/patchwork/utf8) to your composer.json

TorCoGit commented 2 years ago

I understand. How can I add this into the composer.json? Can you give me a short instruction?

koertho commented 2 years ago

In your projekt you have a composer.json file. Just add "patchwork/utf8": "^1.3" within the require-section there.

TorCoGit commented 2 years ago

Can I do this also with the contao manager?

koertho commented 2 years ago

I don't think so. But after you added the line there, you can run the update from the contao manager.

TorCoGit commented 2 years ago

This worked fine. Thanks a lot.

koertho commented 2 years ago

Is fixed in 1.6.1