-
Notifications
You must be signed in to change notification settings - Fork 314
BugFix: Wrong input date on reservation edit #654
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents the default date from overwriting existing reservation dates on the reservation edit page by only applying it on other pages.
- Wraps the default date assignment in a conditional that skips when viewing reservation.php.
- Ensures start/end dates on reservation edit correctly reflect the selected event.
Comments suppressed due to low confidence (2)
tpl/Controls/DateSetup.tpl:19
- [nitpick] Add a comment above this condition explaining why the default date assignment must be skipped on
reservation.php, so future maintainers understand the exception.
{if $smarty.server.SCRIPT_NAME|basename != 'reservation.php'}
tpl/Controls/DateSetup.tpl:19
- Consider adding a test to verify that
defaultDateis not applied onreservation.php, ensuring this conditional behavior remains covered and preventing regressions.
{if $smarty.server.SCRIPT_NAME|basename != 'reservation.php'}
|
@madyel Need to squash down and get rid of the bad commits. Adding more commits doesn't fix it. As the comittizen check is checking all the commit messages of all the commits. If you need help on squashing commits please let me know. |
|
@JohnVillalovos Thanks for the tip, really appreciated! You were right — adding more commits didn’t help. I squashed everything. |
|
Thanks for the PR. Until others can reproduce the bug I am going to wait on merging in a fix. We need more information on how to reproduce. @lucs7 is working on investigating that. |
|
Thanks for the update! Let me know if there's anything else I can help with in the meantime. |
|
Got it - no worries! Glad the issue is resolved. |
Fix Applied
The issue occurred because the default date was being set unconditionally, even on the reservation.php page, causing a one-day offset.
To resolve this, the following condition was added:
This ensures that the default date is only applied on pages other than reservation.php, preventing it from interfering with the existing reservation values.
As a result, the start and end dates now correctly match the selected event when editing a reservation.