API page: http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupa...

Enter a descriptive title (above) relating to drupal_get_filename, then describe the problem you have found:

There is no mention of what happens when the file is not found. A quick test returned a binary zero. There may be other possibilities in the code.

#7 common.inc-documentation-1908192-7.patch548 bytesmitron
PASSED: [[SimpleTest]]: [MySQL] 49,322 pass(es).
[ View ]


Title:Returns FALSE if the file is not found.document that drupal_get_filename() Returns FALSE if the file is not found.
Version:7.x-dev» 8.x-dev
Issue tags:+Novice, +needs backport to D7

Actually, there is no return value if the file isn't found -- it doesn't return FALSE or any other value. Anyway, this should be documented, in 8.x first and then backported to 7.x.

Title:document that drupal_get_filename() Returns FALSE if the file is not found.Document that drupal_get_filename() has no return value if the file is not found

whoops, title is still not accurate

A function without a return statement returns NULL. It would be great if there was a test that asserted the return value was NULL for a file that did not exist. Does such a test exist?

This issue is about the documentation matching the code, which it currently doesn't.

Sure but before we write the documentation, we better make sure we actually understand the code.

new548 bytes
PASSED: [[SimpleTest]]: [MySQL] 49,322 pass(es).
[ View ]

How about this?

Status:Active» Needs review

Assigned:Unassigned» jhodgdon
Status:Needs review» Reviewed & tested by the community

Thanks, I'll get this committed shortly.

Assigned:jhodgdon» Unassigned
Status:Reviewed & tested by the community» Fixed

Thanks again! Committed to both 8.x and 7.x.

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