Skip to content

Symfony 5.x compatablity #114

@hafkenscheid

Description

@hafkenscheid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions