Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping times: Not possible to add two entries with same start/stop time #2033

Closed
jneuhauser opened this issue Oct 8, 2020 · 4 comments

Comments

@jneuhauser
Copy link

jneuhauser commented Oct 8, 2020

Describe the bug
I've disabled "Allow overlapping time entries" in settings.
I wan't to add two time entries that uses the same time for stop and start.
Now i get the warning that I've already an entry with this time set.

Normally it should be possible to have time entries with:

entry start end
1 19:35 19:40
2 19:40 19:45

But it's only possible to add it like:

entry start end
1 19:35 19:40
2 19:41 19:45

My suggestion is that the following function does checks with >= or <= but it should check with > and <.
https://github.com/kevinpapst/kimai2/blob/1.10.2/src/Repository/TimesheetRepository.php#L999

I'm not a php developer and my knowledge about this specific database request is near zero, so I don't know how to create a proper PR.

To Reproduce

  1. Go to 'Settings'.
  2. Untick 'Allow overlapping time entries'.
  3. Press the play button on the top right to add a new time entry.
  4. Select project and activity.
  5. Set a start time. For example: "19:35"
  6. Set a end time. For example: "19:40"
  7. Save the time entry.
  8. Press again the play button on the top right to add a new time entry
  9. Select again project and activity.
  10. Set again a start time. For example: "19:40" (Note: This is the same time as the previous entry end time)
  11. Set a end time. For example: "19:45"
  12. Save the time entry.
  13. See the warning: "You already have an entry for this time."

Logfile

[2020-10-08 16:38:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "begin = You already have an entry for this time." at /var/www/kimai2/src/API/TimesheetController.php line 689 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): begin = You already have an entry for this time. at /var/www/kimai2/src/API/TimesheetController.php:689)"} []

Additional context

  • Kimai version: 1.10.2
  • PHP version: 7.3.22
  • Device: Server: Debian 10.6 ; Client: Ubuntu Desktop 20.04
  • Browser: Chromium 85.0.4183.121
@jneuhauser jneuhauser added the bug label Oct 8, 2020
@kevinpapst
Copy link
Member

You are explicitly linking to 1.10.2, then you might have seen that this function was modified in master?
https://github.com/kevinpapst/kimai2/blob/master/src/Repository/TimesheetRepository.php#L1008
Give it a try and report back if that fixed your problem.

@HeinzWuert
Copy link

in actual beta this function works as expected!

@jneuhauser
Copy link
Author

Thanks for your help @kevinpapst and @HeinzWuert.
I'll close this issue without a test by myself.

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants