Kimai2: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException

Created on 7 Apr 2020  路  1Comment  路  Source: kevinpapst/kimai2

Describe the bug
I get an Internal Server Error when restarting a Task with a tag, while another task is running (and max allowed running tasks is one).

To Reproduce
Steps to reproduce the behavior:

  • Settings max concurrent running tasks to 1.
  • Create a task A with a description and a tag.
  • End this task A
  • Create a new task B and leave it running.
  • Restart the previous task A with the tag.

Expected: End task B and restart task A.
Output: Internal Server Error ("脛nderungen konnten nicht gespeichert werden")

Logfile
[2020-04-07 09:13:47] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException: "A new entity was found through the relationship 'App\Entity\Tag#timesheets' that was not configured to cascade persist operations for entity: App\Entity\Timesheet@0000000016ff5ae30000000051f65311. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem implement 'App\Entity\Timesheet#__toString()' to get a clue." at /opt/kimai/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 102 {"exception":"[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship 'App\Entity\Tag#timesheets' that was not configured to cascade persist operations for entity: App\Entity\Timesheet@0000000016ff5ae30000000051f65311. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={\"persist\"}). If you cannot find out which entity causes the problem implement 'App\Entity\Timesheet#__toString()' to get a clue. at /opt/kimai/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:102)"} []

Desktop/Smartphone
Please complete the following information if this seems to be a frontend issue:

  • Device: Any Desktop
  • OS: Windows and Mac (possibly all)
  • Browser: Chrome, Safari, Firefox (possibly all)
  • Version: any

Additional context
Add any other context about the problem here.

  • Kimai version: 1.8 (Docker: kimai/kimai2:apache-debian-1.8-prod)
  • PHP version: 7.3.10 (see Docker Image)
bug

Most helpful comment

Thanks for the report, I can reproduce the bug.

>All comments

Thanks for the report, I can reproduce the bug.

Was this page helpful?
0 / 5 - 0 ratings