Closed romainneutron closed 6 years ago
I've created a reproducer to help you: https://github.com/romainneutron/sonata-reproducer
Just
git clone
composer install
./bin/console server:run
and go to http://localhost:8000/app_dev.php/admin/dashboard
Problem reproduced. It looks like setDefaultSettings
is never called.
protected function setDefaultSettings(OptionsResolverInterface $optionsResolver, BlockInterface $block)
{
if (get_called_class() !== __CLASS__) {
@trigger_error('The '.__METHOD__.' is deprecated since version 2.3, to be renamed in 3.0. Use '.__CLASS__.'::configureSettings instead.', E_USER_DEPRECATED);
}
$this->configureSettings($optionsResolver, $block);
}
Hum…
@greg0ire This is from me, I have to investigate.
The best thing to do for the moment is to use configureSettings
instead.
I thought it would change nothing, but I get another error when trying that.
An exception has been thrown during the rendering of a template ("There are no registered paths for namespace "App".") in SonataAdminBundle:Core:dashboard.html.twig at line 60.
@greg0ire This is from me, I have to investigate.
Ok, I'll let you manage that one.
thanks guys
@greg0ire I tried what you said, I used configureSettings instead of setDefaultSettings an dI got the error
An exception has been thrown during the rendering of a template ("There are no registered paths for namespace "App".") in SonataAdminBundle:Core:dashboard.html.twig at line 60.
But it's normal, I forgot to add the template in my reproducer!
So thank you, this works.
What about dropping the use of setDefaultSettings?
What about dropping the use of setDefaultSettings?
There is already a deprecation warning, which means it will be dropped in the next major. The problem is that somehow, the forward to configureSettings does not work…
@Soullivaneuh should we close this or leave it open for you?
3.1 should work with both methods or am i wrong?
3.1 should work with both methods or am i wrong?
No, I think you're right, that's what I was pointing out by "The problem is that somehow, the forward to configureSettings does not work…"
@romainneutron please, can you update your repo with the solved issue? I think that I've the same problem but I can't solve it.
@shawe which version of SonataAdminBundle are you using?
I have the Same problem.
sonata-project/admin-bundle 3.19.0
sonata-project/block-bundle 3.3.2
and when I use configureSettings I get another error:
Variable "block" does not exist.
( line )
Any news regarding this issue?
@OskarStark I'm not sure now, but in my composer.lock appear version 3.18.2. I believe that for me, the problem start with 3.18.3, I remember that I need to downgrade one version of a package to 0.0.1 less, but some month after I don't remember it clearly and exactly what specific downgrade solve the issue for me now.
Error message
Steps to reproduce
I've described a configuration like this:
with a service:
Here's my class:
When I render the admin dashboard, I got the error
Expected results
No error, rendering
Actual results
error