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

Errors with Blocked Periods in Calendar Default View #1497

Closed
tm8544 opened this issue Apr 13, 2024 · 3 comments
Closed

Errors with Blocked Periods in Calendar Default View #1497

tm8544 opened this issue Apr 13, 2024 · 3 comments

Comments

@tm8544
Copy link

tm8544 commented Apr 13, 2024

In v1.5.0-dev.4 there are several issues with blocked periods in calendar default view

  1. Set a blocked period that is not whole day: This can be set and edited, but when deleted, there is error message "json_decode(): Argument #1 ($json) must be of type string, array given"

  2. Set a blocked period that is whole day: This can't be set, there is error message

"A PHP ERROR WAS ENCOUNTERED
SEVERITY
Warning

MESSAGE
Trying to access array offset on value of type null

FILENAME
models/Providers_model.php

LINE NUMBER
500

A PHP ERROR WAS ENCOUNTERED
SEVERITY
8192

MESSAGE
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

FILENAME
models/Providers_model.php

LINE NUMBER
500

A PHP ERROR WAS ENCOUNTERED
SEVERITY
Warning

MESSAGE
Trying to access array offset on value of type null

FILENAME
models/Providers_model.php

LINE NUMBER
502

A PHP ERROR WAS ENCOUNTERED
SEVERITY
8192

MESSAGE
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

FILENAME
models/Providers_model.php

LINE NUMBER
502"

  1. Problem in line 2 can be circumvented with editing Providers_model.php like this:
500 - $start = date('H:i', strtotime($working_plan_exception['start']));
500 + $start = (!empty($working_plan_exception['start']) ? date('H:i', strtotime($working_plan_exception['start'])) : null);

502 - $end = date('H:i', strtotime($working_plan_exception['end'])));
502 + $end = (!empty($working_plan_exception['end']) ? date('H:i', strtotime($working_plan_exception['end'])) : null);
  1. After this edit, full day exception can be set, but there remains a problem when deleting it. On delete, there is error message "No appointment id provided."
tm8544 added a commit to tm8544/easyappointments that referenced this issue Apr 14, 2024
@alextselegidis
Copy link
Owner

Hello!

Thanks for reporting this!

From the description I can tell that this is not about blocked periods but working plan exceptions.

Based on that I was able to fix the first and last issue (working plan exception removal in calendar page), but was not able to replicate the other two.

Can you elaborate on those?

Kapture.2024-04-15.at.14.27.12.mp4
Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

@tm8544
Copy link
Author

tm8544 commented Apr 15, 2024

Assuming that line 322 in application/models/Providers_model.php has been merged and lines 214-215 in assets/js/utils/calendar_default_view.js, both from dec0cf9 , have been merged, there remains the following problem:

Nimeton.video.mp4

Or is the cause of this that I'm using PHP 8.1?

@tm8544
Copy link
Author

tm8544 commented May 12, 2024

It seems that this error is gone with merge on 11.5.2024. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants