Results 1 to 2 of 2

Thread: Problem with the Contao after upgrade 4.13 to 5.3

  1. #1
    User tetrijeb's Avatar
    Join Date
    04-19-12.
    Location
    Bosnia&Herzegovina
    Posts
    114

    Default Problem with the Contao after upgrade 4.13 to 5.3

    Hi,

    I upgraded my Contao website from 4.13.38 to 5.3.1. Everything was successful, Contao Manager is working okay, but the website is not functioning. The error is logged in var/logs as:


    Code:
    Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "contao.image.image_sizes". Did you mean one of these: "contao.image.imagine", "contao.image.imagine_svg", "contao.image.resizer", "contao.image.sizes"?" at Container.php line 263
    
    {
    "exception": 
    "[object] (Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException(code: 0): You have requested a non-existent service "contao.image.image_sizes". Did you mean one of these: "contao.image.imagine", "contao.image.imagine_svg", "contao.image.resizer", "contao.image.sizes"? at /opt/testportal/vendor/symfony/dependency-injection/Container.php:263)"
    }
    {
    "request_uri": "https://testportal/contao/login",
    "request_method": "GET"
    }
    Both FE and BE are not working.

    What could be the problem here? I searched for solution in Internet, but although there were similar questions, I didn't find real solution.

    Beside contao-core, rocksolidthemes plugins are installed in Contao.
    Last edited by tetrijeb; 03/13/2024 at 15:48.

  2. #2
    User tetrijeb's Avatar
    Join Date
    04-19-12.
    Location
    Bosnia&Herzegovina
    Posts
    114

    Default

    Finally,

    We solved the problem. In folder config there should be added file services.yaml with following code:

    Code:
    services:
        contao.image.image_sizes:
            class: Contao\CoreBundle\Image\ImageSizes
            public: true
            arguments:
              - '@database_connection'
              - '@event_dispatcher'
              - '@contao.translation.translator

    This is the same configuration as it is for service contao.image.sizes in core-bundle, but for some reason the system is searching for contao.image.image_sizes. Since that service is not exists, we copied the definition under the name of missing service.

    Somewhere I found this code, and there is probably why the system is searching for contao.image.image_sizes

    Code:
    public static function getImageSizes()
        {
            @trigger_error('Using System::getImageSizes() has been deprecated and will no longer work in Contao 5.0. Use the contao.image.image_sizes service instead.', E_USER_DEPRECATED);
            return static::getContainer()->get('contao.image.image_sizes')->getAllOptions();
        }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •