pix-digital / pixSortableBehaviorBundle

Offers a sortable feature for your Symfony2 admin listing
MIT License
46 stars 78 forks source link

Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct() #95

Open smilesrg opened 1 year ago

smilesrg commented 1 year ago

With symfony/config v5.4.11 such error happens:

!!  ArgumentCountError {#16254
!!    #message: "Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in vendor/pixassociates/sortable-behavior-bundle/Pix/SortableBehaviorBundle/DependencyInjection/Configuration.php on line 30 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/pixassociates/sortable-behavior-bundle/Pix/SortableBehaviorBundle/DependencyInjection/Configuration.php:30 { …}
!!      ./vendor/symfony/config/Definition/Processor.php:46 { …}
!!      ./vendor/symfony/dependency-injection/Extension/Extension.php:111 { …}
!!      ./vendor/pixassociates/sortable-behavior-bundle/Pix/SortableBehaviorBundle/DependencyInjection/PixSortableBehaviorExtension.php:32 { …}
!!      ./vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php:76 { …}
!!      ./vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php:42 { …}
!!      ./vendor/symfony/dependency-injection/Compiler/Compiler.php:82 { …}
!!      ./vendor/symfony/dependency-injection/ContainerBuilder.php:757 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:546 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:787 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:128 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
!!      ./vendor/symfony/console/Application.php:171 { …}
!!      ./bin/console:43 {
!!        › $application = new SignalableApplication($kernel); // TODO: Remove once migrated to Symfony 5.2
!!        › $application->run($input);
!!        › 
!!        arguments: {
!!          $input: Symfony\Component\Console\Input\ArgvInput {#4 …}
!!        }
!!      }
!!    }
!!  }
Nincha commented 1 year ago

Same here. :)

Nincha commented 1 year ago

With a little advice of GPT-3 (yea I know, shame on me :p) I could experiment that replacing in \vendor\pixassociates\sortable-behavior-bundle\Pix\SortableBehaviorBundle\DependencyInjection\PixSortableBehaviorExtension.php :

        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('pix_sortable_behavior');

By

        $treeBuilder = new TreeBuilder('pix_sortable_behavior');
        $rootNode = $treeBuilder->getRootNode();

Would resolve access to all the methods in the file (according to IDE), but still throws error:

Attempted to load class "Twig_Extension" from the global namespace. Did you forget a "use" statement?

I won't dig further because everything else would be pure guess, but it case it can help someone who knows best, heh. :)