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.
Comment | File | Size | Author |
---|---|---|---|
#7 | common.inc-documentation-1908192-7.patch | 548 bytes | mitron |
Comments
Comment #1
jhodgdonActually, 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.
Comment #2
jhodgdonwhoops, title is still not accurate
Comment #3
mitron CreditAttribution: mitron commentedA 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?
Comment #4
jhodgdonThis issue is about the documentation matching the code, which it currently doesn't.
Comment #5
mitron CreditAttribution: mitron commentedSure but before we write the documentation, we better make sure we actually understand the code.
Comment #6
peterx CreditAttribution: peterx commentedMy quick test: http://petermoulding.com/test_drupal_functions
Comment #7
mitron CreditAttribution: mitron commentedHow about this?
Comment #8
mitron CreditAttribution: mitron commentedComment #9
mitron CreditAttribution: mitron commentedNote related issue Test that drupal_get_filename() has NULL return value when the file is not found.
Comment #10
jhodgdonThanks, I'll get this committed shortly.
Comment #11
jhodgdonThanks again! Committed to both 8.x and 7.x.