Page MenuHomePhorge

Calendar: Call to a member function format() on null at $this->getQueryDateFrom($query)->getDateTime()
Open, Needs TriagePublic

Description

Upstreaming from https://phabricator.wikimedia.org/T372857

Steps to reproduce:

  1. Go to http://phorge.localhost/calendar/query/month/ and http://phorge.localhost/calendar/query/day/
  2. Click the Edit Query button in the upper right corner
  3. Check the Occurs After and/or Occurs Before options
  4. Replace default date and/or time values with gibberish like abcde
  5. Click the Search button

Actual outcome:

[2024-09-18 12:49:02] EXCEPTION: (Error) Call to a member function format() on null at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:469]
arcanist(head=master, ref.master=0358ff7ee314), phorge(head=calVerifyUserDates, ref.master=85f51c54303f, ref.calVerifyUserDates=85f51c54303f)
  #0 phlog(Error) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #1 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Error) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:753]
  #2 AphrontApplicationConfiguration::handleThrowable(Error) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #3 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #4 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Expected outcome:
Throw a less cryptic exception with an explanation.