New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save as draft - DateTime validation error #7459
Labels
Comments
Doh, thanks for pointing that out! Just released 3.5.19.1 with the same fix. |
|
As a mention, this error also happened when indexing assets through the CLI:
I think it is related, will update Craft and report back if issue has been resolved. |
@michtio Yeah the bug was in DateTimeValidator. 3.5.19.1 will fix that one too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
After updating to Craft 3.5.19 (which contains a fix for #7404 ) whenever I save a draft or try to preview it or view it I get an error ("A server error occurred."). In the logs I can see this:
2021-01-28 15:14:44 [-][1][-][error][ArgumentCountError] ArgumentCountError: Too few arguments to function craft\helpers\DateTimeHelper::toDateTime(), 0 passed in /Library/WebServer/Documents/src/motability/drc/vendor/craftcms/cms/src/validators/DateTimeValidator.php on line 81 and at least 1 expected in vendor/craftcms/cms/src/helpers/DateTimeHelper.php:83
Downgrading to version 3.5.18 solves this problem.
Changing line 81 of
vendor/craftcms/cms/src/helpers/DateTimeHelper.php
from:$value = DateTimeHelper::toDateTime();
to
$value = DateTimeHelper::toDateTime($value);
also seems to fix the problem (but I haven't checked any other implications of doing this).
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: