Skip to content

Conversation

Romanavr
Copy link

Basically, I was getting an error when the “expires” string was empty, ''.

The DateTime helper method used in the newest version of Craft swears if you try to pass an empty string.
I suggest solving the problem this way, but feel free to close my PR and suggest something else, it's just one possible option.

web_php_error  2025-06-25T16:06:44Z Stack trace:
web_php_error  2025-06-25T16:06:44Z 2025-06-25 12:06:44 [104.23.166.65][11320][4b7cc31df35ff609ae5a4d3cb952515b][error][DateMalformedIntervalStringException] DateMalformedIntervalStringException: Unknown or bad format () at position 0 ( ): Empty string in /srv/app/sitename/htdocs/vendor/craftcms/cms/src/helpers/DateTimeHelper.php:745
web_php_error  2025-06-25T16:06:44Z #4 /srv/app/sitename/htdocs/vendor/craftcms/cms/src/elements/Asset.php(3252): craft\models\Volume->writeFileFromStream('Downloads/test_...', Resource id #257, Array)

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

Successfully merging this pull request may close these issues.

1 participant