2

I use sonata admin/userBundle and FosUserBundle but when I check the profile page "/profile",I get this strange error :

FatalErrorException: Error: Class 'Symfony\Component\Debug\Exception\FlattenException' not found in /var/www/project/vendor/sonata-project/user-bundle/Sonata/UserBundle/Block/ProfileMenuBlockService.php line 97
2
  • You probably forgot to add some class dependencies (eg. "use .."). Check if you correctly import every used class in ProfileMenuBlockService.php. Commented Feb 3, 2014 at 10:32
  • I got the same problem, not sure if it is a PHP or Symfony bug. Commented Feb 22, 2014 at 14:27

1 Answer 1

3

I got the same error a few weeks ago. First time I ever heard of a flattened exception.

I have a BaseController class with two derived controller classes (AccountController and PersonController)

Each of the derived controllers had a createModel() method with different arguments. I decided to clean things up by adding a createModel() method to the BaseController. I started with PersonController and all seemed well.

I then cleared the development cache and suddenly got the flattened exception error. Something in the cache creation process had determined that the arguments to AccountController::createModel() did not match the arguments in BaseController::createModel(). PHP did not care since AccountController was never calling BaseController::createModel. But the cache builder was. Fixing the arguments solved the problem.

The question does not give us much to go on but you might take a look at any inheritance type changes that you may have made.

Sign up to request clarification or add additional context in comments.

2 Comments

can you see my Edit in my first message
The new error message is a completely different issue. I'd suggest starting another question since the title of this one is now very inaccurate. Hint: it is a template problem. I suspect you may have been copy/pasting things with really understanding. Try searching the net for fields.html.twig

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.