Closed lucciano closed 4 years ago
Can you please provide a little more information instead of all technical details.
Can you please provide a full stack trace?
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorException: Warning: array_merge(): Argument #2 is not an array in /drone/src/bitbucket.org/ikflowdat/ftth/vendor/sonata-project/admin-bundle/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php:362
Stack trace:
#0 /drone/src/bitbucket.org/ikflowdat/ftth/vendor/sonata-project/admin-bundle/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php(338): Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass->fixTemplates(Object(Symfony\Component\DependencyInjection\ContainerBuilder), Object(Symfony\Component\DependencyInjection\Definition), Array)
#1 /drone/src/bitbucket.org/ikflowdat/ftth/vendor/sonata-project/admin-bundle/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php(67): Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass->applyDefaults(Object(Symfony\Component\DependencyInjection\ContainerBuilder), 'ftth.admin.onu', Array)
#2 /drone/src/bitbucket.org/ikflowdat/ftth/vend in /drone/src/bitbucket.org/ikflowdat/ftth/vendor/sonata-project/admin-bundle/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php on line 362
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
@lucciano Please check you've passed an array (and not a scalar) as the first parameter of the setTemplates
method call in your ftth.admin.onu
service definition.
@jlamur I don't call setTemplate directlly, it get called when the admin is wired with the tag "sonata.admin"
Please var_dump($method[1][0]);die();
@greg0ire
string(38) "%sonata.admin.configuration.templates%"
I patch the Line 362, with a cast and it looks ok, https://github.com/lucciano/SonataAdminBundle/commit/691217d41231c1b2e43279d51b4ca6fec410140b
Probably related to #4580
EDIT: now sure how though, unless fixTemplates
is called several times?
The other option is to change L 393 to
$definition->addMethodCall('setTemplates', array(array('%sonata.admin.configuration.templates%')));
This makes a lot more sense.
Or does it? I'm not sure anymore...
That would mean the first argument of setTemplates
would be array('%sonata.admin.configuration.templates%')
, which should result into a 2-dimensional array... pretty weird.
Maybe the right solution would be to resolve the parameter before merging it
Or maybe: just don't merge if it's not an array.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Sonata packages
sonata-project/admin-bundle 3.23.0 3.23.0 The missing Symfony Admin Generator
sonata-project/block-bundle 3.2.0 3.4.0 Symfony SonataBlockBundle sonata-project/cache 1.0.0 1.0.7 Cache library sonata-project/core-bundle 3.4.0 3.5.1 Symfony SonataCoreBundle sonata-project/datagrid-bundle 2.2 2.2.1 Symfony SonataDatagridBundle sonata-project/doctrine-orm-admin-bundle 3.1.0 3.1.7 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle sonata-project/exporter 1.7.0 1.7.1 Lightweight Exporter library
Symfony packages
symfony/monolog-bundle v3.1.0 v3.1.1 Symfony MonologBundle
symfony/phpunit-bridge v3.3.0 v3.3.9 Symfony PHPUnit Bridge symfony/polyfill-apcu v1.1.0 v1.5.0 Symfony polyfill backporting apcu_* functions to lower PHP versions symfony/polyfill-intl-icu v1.0.0 v1.5.0 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-mbstring v1.0.0 v1.5.0 Symfony polyfill for the Mbstring extension symfony/polyfill-php56 v1.0.0 v1.5.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions symfony/polyfill-php70 v1.0.0 v1.5.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions symfony/polyfill-util v1.0.0 v1.5.0 Symfony utilities for portability of PHP codes symfony/security-acl v3.0.0 v3.0.0 Symfony Security Component - ACL (Access Control List) symfony/swiftmailer-bundle v2.3.10 v3.0.3 Symfony SwiftmailerBundle symfony/symfony v3.3.0 v3.3.9 The Symfony PHP framework
PHP version
Subject
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorException: Warning: array_merge(): Argument #2 is not an array