Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 5 incompatibility #24

Closed
ameotoko opened this issue Mar 4, 2021 · 4 comments
Closed

Symfony 5 incompatibility #24

ameotoko opened this issue Mar 4, 2021 · 4 comments

Comments

@ameotoko
Copy link

ameotoko commented Mar 4, 2021

contao-url-rewrite currently cannot be installed with Contao 4.11, which is fine, but there is a problem if I'm trying to upgrade existing 4.10 installation when contao-url-rewrite is already installed. post-update-cmd fails with Script @php vendor/bin/contao-setup handling the post-update-cmd event returned with error code 255, and contao-console is broken with the following stack trace:

ArgumentCountError {#4049
  #message: "Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /Users/andrey/Sites/classic-at-home/vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php on line 24 and at least 1 expected"
  #code: 0
  #file: "./vendor/symfony/config/Definition/Builder/TreeBuilder.php"
  #line: 26
  trace: {
    ./vendor/symfony/config/Definition/Builder/TreeBuilder.php:26 { …}
    ./vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php:24 { …}
    ./vendor/symfony/config/Definition/Processor.php:50 { …}
    ./vendor/symfony/dependency-injection/Extension/Extension.php:111 { …}
    ./vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php:35 { …}
    ./vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php:76 { …}
    ./vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 { …}
    ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}
    ./vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …}
    ./vendor/symfony/http-kernel/Kernel.php:541 { …}
    ./vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php:311 { …}
    ./vendor/symfony/http-kernel/Kernel.php:780 { …}
    ./vendor/symfony/http-kernel/Kernel.php:121 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
    ./vendor/symfony/console/Application.php:166 { …}
    ./vendor/contao/manager-bundle/bin/contao-console:37 { …}
  }
}

On a project level, this can be solved by locking Symfony at 4.4.*.

See also contao/contao#2844 (comment)

@Flo-JB
Copy link

Flo-JB commented Mar 10, 2021

Even if you pass the TreeBuilder-Error you will get an error later on creating new redirect rules because the router option "generator_cache_class" isn't available anymore in Symfony 5

https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.0.md

Maybe additional changes are needed

@tonsinn
Copy link

tonsinn commented Mar 10, 2021

Yes, I confirm: terminal42/contao-url-rewrite prevents contao upgrade to 4.11
Install-Tool fails and I get in SSH:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /www/htdocs/domain.tld/vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php on line 24 and at least 1 expected in /www/htdocs/domain.tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php:26
Stack trace:
#0 /www/htdocs/domain.tld/vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php(24): Symfony\Component\Config\Definition\Builder\TreeBuilder->__construct()
#1 /www/htdocs/domain.tld/vendor/symfony/config/Definition/Processor.php(50): Terminal42\UrlRewriteBundle\DependencyInjection\Configuration->getConfigTreeBuilder()
#2 /www/htdocs/domain.tld/vendor/symfony/dependency-injection/Extension/Extension.php(111): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(Terminal42\UrlRewriteBundle\DependencyInjection\Configuration), Arra in /www/htdocs/domain.tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php on line 26
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /www/htdocs/domain.tld/vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php on line 24 and at least 1 expected in /www/htdocs/domain.tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php:26
Stack trace:
#0 /www/htdocs/domain.tld/vendor/terminal42/contao-url-rewrite/src/DependencyInjection/Configuration.php(24): Symfony\Component\Config\Definition\Builder\TreeBuilder->__construct()
#1 /www/htdocs/domain.tld/vendor/symfony/config/Definition/Processor.php(50): Terminal42\UrlRewriteBundle\DependencyInjection\Configuration->getConfigTreeBuilder()
#2 /www/htdocs/domain.tld/vendor/symfony/dependency-injection/Extension/Extension.php(111): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(Terminal42\UrlRewriteBundle\DependencyInjection\Configuration), Arra in /www/htdocs/domain.tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php on line 26

@fritzmg
Copy link
Sponsor

fritzmg commented Mar 10, 2021

Yes, I confirm: terminal42/contao-url-rewrite prevents contao upgrade to 4.11

@adera-web The update itself was not prevented. The error happens after updating, because Symfony gets updated to version 5 as well with Contao 4.11. As already mentioned in the initial post you can work around the error for now by forcing the installation of Symfony 4.

rabauss added a commit to rabauss/contao-url-rewrite that referenced this issue Apr 3, 2021
rabauss added a commit to rabauss/contao-url-rewrite that referenced this issue Apr 3, 2021
richardhj pushed a commit that referenced this issue Apr 3, 2021
* CS
* Replace deprecated ContaoFrameworkInterface by ContaoFramework
* Update gitignore
* Fix usage of treeBuilder for symfony 5 #24
* Fix clearSymfonyRouterCache for symfony 5 #24
@rabauss
Copy link
Contributor

rabauss commented Apr 3, 2021

Should be fixed with #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants