Your software
My Mautic version is: 4.1.2
My PHP version is: 7.4
My Database type and version is: MariaDB 10.3.32
Your problem
My problem is:
I’ve attempted to filter contacts by using a “Contact field value” condition in the campaign builder.
I need to filter by match against a “date-added” contact field.
I have built a Regex pattern to match the appropriate values. Please see here: regex101: build, test, and debug regex
Mautic produces a consistent error for this. See log output for error log.
Reproduce by:
Step 1: Create campaign with a “Contact field value” condition.
Step 2: Set the condition to match a field containing a date formatted in the following: F j, Y G:i:s (eg: February 13, 2022 9:22:41).
Step 3: Save the campaign and allow it to run or run it manually.
These errors are showing in the log:
[2022-02-14 10:35:21] mautic.CRITICAL: Uncaught PHP Exception Exception: “DateTime::__construct(): Failed to parse time string (8) at position 0 (8): Unexpected character” at /var/www/mautic-xxx.xxx.xxx/app/bundles/CampaignBundle/Entity/Event.php line 1015 {“exception”:"[object] (Exception(code: 0): DateTime::__construct(): Failed to parse time string (8) at position 0 (8): Unexpected character at /var/www/mautic-xxx.xxx.xxx/app/bundles/CampaignBundle/Entity/Event.php:1015)"}
[2022-02-14 11:47:32] mautic.ERROR: CAMPAIGN: DateTime::__construct(): Failed to parse time string (\b([8-9]|[1][0-6]):[0-5]0-9?(?i)\b) at position 0 (): Unexpected character
Updated/different regex string:
[2022-02-15 07:39:32] mautic.ERROR: CAMPAIGN: DateTime::__construct(): Failed to parse time string ((0?[8-9]|1[0-6]):([0-5][0-9]):([0-9][0-9])) at position 0 ((): Unexpected character
Steps I have tried to fix the problem:
Tried different regex strings ad nauseum.