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

PHP Deprecated function (8192): strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/html/glpi/src/Calendar.php at line 244 #18283

Closed
2 tasks done
danielmbicalho opened this issue Nov 11, 2024 · 4 comments

Comments

@danielmbicalho
Copy link

danielmbicalho commented Nov 11, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.17

Bug description

Some itil categories are presenting errors on create or solve the tickets.

Relevant log output

[2024-11-11 10:32:35] glpiphplog.NOTICE:   *** PHP Deprecated function (8192): strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/html/glpi/src/Calendar.php at line 244
  Backtrace :
  src/Calendar.php:244                               strtotime()
  src/Calendar.php:544                               Calendar->isHoliday()
  src/LevelAgreement.php:843                         Calendar->computeEndDate()
  src/CommonITILObject.php:2375                      LevelAgreement->computeDate()
  src/Ticket.php:1615                                CommonITILObject->pre_updateInDB()
  src/CommonDBTM.php:1700                            Ticket->pre_updateInDB()
  front/ticket.form.php:90                           CommonDBTM->update()
  public/index.php:82                                require()

Page URL

/front/ticket.form.php?id=52285

Steps To reproduce

  1. Open the ticket
  2. Change the situation to Solved
  3. Click the save button
  4. the glpi process and crash
  5. on debug mod, shows the message:
PHP Deprecated function (8192): strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/html/glpi/src/Calendar.php at line 244

Your GLPI setup information

No response

Anything else?

No response

@trasher
Copy link
Contributor

trasher commented Nov 12, 2024

This means there is a "calendar holiday" entry in your database that does not have an end date; I wonder if that should really happens (even if it seems to be currently permitted).
As a workaround, adding an end date should do the trick.

@trasher
Copy link
Contributor

trasher commented Nov 12, 2024

BTW, I've just tested, and that does not seems a legit case: when creating a holiday, if you do not give an end date, it's set to start date automatically.

@danielmbicalho
Copy link
Author

Ok.I Understood the problem. Thanks for orientation

@guillermohaad
Copy link

thank you @trasher This bug causes many problems with processes that use the calendar. I had been having problems for several months and could not find a solution. Thank you for explaining it.

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

3 participants