Page MenuHomePhorge

Avoid search exception for calendar events when using localized time formats
Needs ReviewPublic

Authored by aklapper on Sat, May 4, 12:21.
Tags
None
Referenced Files
F2194500: D25618.1716073506.diff
Fri, May 17, 23:05
F2194485: D25618.1716071638.diff
Fri, May 17, 22:33
Unknown Object (File)
Wed, May 15, 09:59
Unknown Object (File)
Sun, May 12, 22:05
Unknown Object (File)
Sun, May 12, 10:09
Unknown Object (File)
Fri, May 10, 13:21
Unknown Object (File)
Fri, May 10, 03:55
Unknown Object (File)
Thu, May 9, 12:09

Details

Summary

Do not call formatTime which will return a localized time format (based on the translation setting of the user) which then fails to match the (English language) $translatable characters defined in PhutilTranslator.php, throwing a search exception when calendar items match the search query string.

Also update DateTime exception handling comment per changes in PHP 8.3:
https://www.php.net/manual/en/class.datemalformedstringexception.php

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]

Closes T15811

Test Plan

Please follow the verbose steps in T15811. In short: Install the Translations extension, set your language to a language which translated AM/PM in time strings, create a calendar event, use the global search to search for the calendar event title.

Diff Detail

Repository
rP Phorge
Branch
amPmCalExplode (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1221
Build 1221: arc lint + arc unit