SettingsBundle icon indicating copy to clipboard operation
SettingsBundle copied to clipboard

Symfony 5.x compatablity

Open hafkenscheid opened this issue 4 years ago • 2 comments

Today I installed this bundle in my SF 5.1 project and encountered the following issues:

Routing not working properly

Changed:

# Dmishh\SettingsBundle\Resources\config\routing.yml
dmishh_settings_manage_global:
    path:         /global
    defaults:     { _controller: DmishhSettingsBundle:Settings:manageGlobal }

dmishh_settings_manage_own:
    path:         /personal
    defaults:     { _controller: DmishhSettingsBundle:Settings:manageOwn }

into:

# Dmishh\SettingsBundle\Resources\config\routing.yml
dmishh_settings_manage_global:
    path:         /global
    defaults:
        _controller: Dmishh\SettingsBundle\Controller\SettingsController::manageGlobalAction

dmishh_settings_manage_own:
    path:         /personal
    defaults:
        _controller: Dmishh\SettingsBundle\Controller\SettingsController::manageOwnAction

Autowiring not working properly

Changed:

# Dmishh\SettingsBundle\Resources\config\services.yml
    Dmishh\SettingsBundle\Controller\SettingsController:
        arguments:
            - '@translator'
            - '@Dmishh\SettingsBundle\Manager\SettingsManagerInterface'
            - ~ # template
            - ~ # manage own settings
            - ~ # security role

Into:

# Dmishh\SettingsBundle\Resources\config\services.yml
    Dmishh\SettingsBundle\Controller\SettingsController:
        public: true
        autowire: true
        tags: ['container.service_subscriber']
        arguments:
            - '@translator'
            - '@Dmishh\SettingsBundle\Manager\SettingsManagerInterface'
            - ~ # template
            - ~ # manage own settings
            - ~ # security role

Using deprecated templating paths

Changed:

// Dmishh\SettingsBundle\DependencyInjection/Configuration.php

//...
        $rootNode
            ->children()
                ->scalarNode('template')
                    ->defaultValue('DmishhSettingsBundle:Settings:manage.html.twig')
//...

Into:

// Dmishh\SettingsBundle\DependencyInjection/Configuration.php

// ...
        $rootNode
            ->children()
                ->scalarNode('template')
                    ->defaultValue('@DmishhSettings/Settings/manage.html.twig')
//...

If I have the time, I will open a PR.

hafkenscheid avatar Dec 27 '20 21:12 hafkenscheid

Would be great if you can open a PR, so we can get this resolved.

rvanlaak avatar May 10 '21 08:05 rvanlaak

In that case, it might also be time to loose SF3.4 compatibility and update the dependencies.

hafkenscheid avatar May 10 '21 17:05 hafkenscheid