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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Status: Needs review » Needs work
Issue tags: +Needs backport to D7

Good 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...

Liam Morland’s picture

Status: Needs work » Needs review
FileSize
428 bytes

Updated patch attached. I will write the D7 backport once the D8 one is approved.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks 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).

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x/7.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.