Page MenuHomePhorge

Search exception when AM/PM string is localized in Calendar application
Open, Needs TriagePublic

Description

Steps to reproduce:

  1. Phorge at 81653abb5440109eb82c734d1671753a738dec3a, PHP 8.3.6 (DateMalformedStringException was introduced in 8.3)
  2. Make sure Calendar prototype application is installed at http://phorge.localhost/applications/view/PhabricatorCalendarApplication/
  3. Install translations extension via git clone https://gerrit.wikimedia.org/r/phabricator/translations, make sure to use revision 8907cd5c6ad807732e5c5dc81a096f5114922d4d (as the offending strings were removed in https://gerrit.wikimedia.org/r/plugins/gitiles/phabricator/translations/+/094f99069cbae82366a9902ca5865b78cda02f78 ), and follow https://we.phorge.it/w/docs/extensions/install/
  4. Enable http://phorge.localhost/config/edit/phabricator.developer-mode/
  5. Set up calendar event E9 called abcdefgh on some day from 11:00 AM to 5:00 PM
  6. Keep Time Format as Default on http://phorge.localhost/settings/panel/datetime/
  7. Set Translation to Finnish (which translates AM to epp.) on http://phorge.localhost/settings/panel/language/
  8. Go to http://phorge.localhost/search/query/advanced/ , enter abcdefgh as the search term, set Document Types to Event and click Search button

Expected outcome:
Search results

Actual outcome:

[2024-05-04 11:56:09] EXCEPTION: (PhutilAggregateException) All of the configured Fulltext Search services failed.
    - DateMalformedStringException: Failed to parse time string (2024-05-04 12:00 epp.) at position 17 (e): The timezone could not be found in the database at [<phorge>/src/infrastructure/cluster/search/PhabricatorSearchService.php:276]
arcanist(head=master, ref.master=ef73b12b580e), phorge(head=amPmCalExplode, ref.master=81653abb5440, ref.amPmCalExplode=81653abb5440), translations(head=wmf/stable, ref.master=09fe573a932a, ref.wmf/stable=e45c643766c8)
  #0 <#3> DateTime::__construct(string, DateTimeZone) called at [<phorge>/src/view/form/control/AphrontFormDateControlValue.php:267]
  #1 <#3> AphrontFormDateControlValue::getFormattedDateFromParts(string, string, string, string) called at [<phorge>/src/view/form/control/AphrontFormDateControlValue.php:109]
  #2 <#3> AphrontFormDateControlValue::newFromEpoch(PhabricatorUser, string) called at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:567]
  #3 <#3> PhabricatorCalendarEventSearchEngine::getSafeDate(NULL) called at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:155]
  #4 <#3> PhabricatorCalendarEventSearchEngine::getQueryDateRange(NULL, NULL, string, boolean) called at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:119]
  #5 <#3> PhabricatorCalendarEventSearchEngine::buildQueryFromParameters(array) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:168]
  #6 <#3> PhabricatorApplicationSearchEngine::buildQueryFromSavedQuery(PhabricatorSavedQuery) called at [<phorge>/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:86]
  #7 <#3> PhabricatorCalendarEventSearchEngine::buildQueryFromSavedQuery(PhabricatorSavedQuery) called at [<phorge>/src/applications/search/fulltextstorage/PhabricatorFerretFulltextStorageEngine.php:76]
  #8 <#3> PhabricatorFerretFulltextStorageEngine::executeSearch(PhabricatorSavedQuery) called at [<phorge>/src/infrastructure/cluster/search/PhabricatorSearchService.php:262]
  #9 <#2> PhabricatorSearchService::newResultSet(PhabricatorSavedQuery, PhabricatorSearchDocumentQuery) called at [<phorge>/src/applications/search/query/PhabricatorSearchDocumentQuery.php:52]
  #10 <#2> PhabricatorSearchDocumentQuery::loadPage() called at [<phorge>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:251]
  #11 <#2> PhabricatorPolicyAwareQuery::execute() called at [<phorge>/src/infrastructure/query/PhabricatorOffsetPagedQuery.php:46]
  #12 <#2> PhabricatorOffsetPagedQuery::executeWithOffsetPager(PHUIPagerView) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1038]
  #13 <#2> PhabricatorApplicationSearchEngine::executeQuery(PhabricatorSearchDocumentQuery, PHUIPagerView) called at [<phorge>/src/applications/search/controller/PhabricatorApplicationSearchController.php:256]
  #14 <#2> PhabricatorApplicationSearchController::processSearchRequest() called at [<phorge>/src/applications/search/controller/PhabricatorApplicationSearchController.php:91]
  #15 <#2> PhabricatorApplicationSearchController::processRequest() called at [<phorge>/src/aphront/AphrontController.php:29]
  #16 <#2> AphrontController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/AphrontController.php:71]
  #17 <#2> AphrontController::delegateToController(PhabricatorApplicationSearchController) called at [<phorge>/src/applications/search/controller/PhabricatorSearchController.php:96]
  #18 <#2> PhabricatorSearchController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #19 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #20 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, PhutilAggregateException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #21 AphrontApplicationConfiguration::handleThrowable(PhutilAggregateException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #22 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #23 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Other comments: