kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.11k stars 543 forks source link

Error 500 when teamlead adds new activity #1271

Closed davidus05 closed 4 years ago

davidus05 commented 4 years ago

Describe the bug As you know, you can add activities for a team on the left hand menu. These will be shown when you add a new time recording. In general, this feature does work well (as server-admin and admin). But if a teamlead (which has rights to add a new activity for his team, too) wants to add a new one at /admin/activity/create, I get an error 500.

To Reproduce Steps to reproduce the behavior:

  1. Go to your Kimai instance
  2. Click on Activities
  3. Add a new activity with the + icon
  4. See the error

Logfile

[2019-11-21 20:37:07] request.INFO: Matched route "admin_activity_create". {"route":"admin_activity_create","route_parameters":{"_route":"admin_activity_create","_controller":"App\\Controller\\ActivityController::createAction","_locale":"de"},"request_uri":"https://*****/de/admin/activity/create","method":"GET"} []
[2019-11-21 20:37:07] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken"} []
[2019-11-21 20:37:07] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/***/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:325)"} []
[2019-11-21 20:37:07] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/***/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:325)"} []
[2019-11-21 20:37:07] security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\\Component\\Security\\Core\\User\\ChainUserProvider","username":"david.wurm"} []
[2019-11-21 20:37:07] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"secured_area","authenticators":1} []
[2019-11-21 20:37:07] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-11-21 20:37:07] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-11-21 20:37:08] php.CRITICAL: Argument 1 passed to Symfony\Component\Form\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\Component\Form\FormView, null given, called in /var/www/***/var/cache/prod/twig/60/60a6e5e49008676881df909f01e9890fde17fd5162cae2aaedf9e3759632d2d1.php on line 188 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Symfony\\Component\\Form\\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\\Component\\Form\\FormView, null given, called in /var/www/***/var/cache/prod/twig/60/60a6e5e49008676881df909f01e9890fde17fd5162cae2aaedf9e3759632d2d1.php on line 188 at /var/www/***/vendor/symfony/form/FormRenderer.php:130)"} []
[2019-11-21 20:37:08] request.CRITICAL: Uncaught PHP Exception TypeError: "Argument 1 passed to Symfony\Component\Form\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\Component\Form\FormView, null given, called in /var/www/***/var/cache/prod/twig/60/60a6e5e49008676881df909f01e9890fde17fd5162cae2aaedf9e3759632d2d1.php on line 188" at /var/www/***/vendor/symfony/form/FormRenderer.php line 130 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Symfony\\Component\\Form\\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\\Component\\Form\\FormView, null given, called in /var/www/***/var/cache/prod/twig/60/60a6e5e49008676881df909f01e9890fde17fd5162cae2aaedf9e3759632d2d1.php on line 188 at /var/www/***/vendor/symfony/form/FormRenderer.php:130)"} []
[2019-11-21 20:37:08] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

Additional context Add any other context about the problem here.

kevinpapst commented 4 years ago

Thanks for the report. I found the problem, will be fixed with the next release

davidus05 commented 4 years ago

Thanks for confirming the bug. Is there any hotfix (changes in file, ...) available to provide my users this feature until release 1.6 comes out?

kevinpapst commented 4 years ago

You can patch the file manually: https://github.com/kevinpapst/kimai2/pull/1270/files#diff-705f38865aeb9bb1d6c588e0d2ac96ef

davidus05 commented 4 years ago

I'm sorry, but none of this fixes solved my problem. :/

kevinpapst commented 4 years ago

Did you clear the cache? https://www.kimai.org/documentation/ftp.html

davidus05 commented 4 years ago

Oh sorry, I forgot about that. Clearing the cache fixed this now, many thanks!

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.