Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The documentation for file_load() says that it returns "A file object". However, it will return FALSE if the file was not found. This patch documents that behavior.
Comment | File | Size | Author |
---|---|---|---|
#2 | doc_file_load_return.patch | 428 bytes | Liam Morland |
doc_file_load_return.patch | 409 bytes | Liam Morland | |
Comments
Comment #1
jhodgdonGood catch! I agree with your assessment: FALSE will be returned if there is no file found.
I think the doc line needs a comma in it though: ", or FALSE if ..."
Actually, how about:
An object representing the file, or FALSE if...
Comment #2
Liam MorlandUpdated patch attached. I will write the D7 backport once the D8 one is approved.
Comment #3
jhodgdonLooks good, thanks! I'll get that committed (it will likely apply to both d7 and d8 with no extra work on your part, so don't bother with that yet).
Comment #4
jhodgdonCommitted to 8.x/7.x. Thanks!