Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently have the situation that every time I start the Nextcloud iOS App, the error "InvalidArgumentException: Invalid type for field mtime" is written to my Nextcloud log, which seems to be connected to #10835. Because the error is caused by method castValue of class FileSearchBackend: It casts the timestamp "0001-12-30T00:49:56+00:49:56" to boolean false. According to the first user contributed note on this page , this happens for timestamps older than the unix epoch. I have very little PHP experience but I fixed this problem by the following change in line 358 , comments or better workarounds are highly appreciated, thanks in advance!
return ($date instanceof \DateTime && $date->getTimestamp()!= false )? $date->getTimestamp() : 0);
stacktrace_InvalidArgumentException.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cviereck Could we ask you to open this as a new issue so it does not get lost. Thanks for the feedback and debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, feel free to make a PR with the proposed changed.