DX: Make file_scan_directory() use save property names as file_load()
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | file system |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
This issue is based on the following request on Drupal core improvements » File system:
“file_scan_directory() should return objects that have the same properties as the $file object returned by file_load(). Right now the file path is $file->path instead of $file->filepath, base name is $file->basename instead of $file->filename. The main complication of this patch is that there are quite a few core functions that directly return the results of this function so the change cascades out.”
I've made a patch that changes this, however, it doesn't go all the way and enforce this terminology throughout Drupal. E.g. it does not rename {registry}.filename to {registry}.filepath even though the fields contains a path a not just a path-less filename. Do we want to do that? And do we want to do it in one big issue, or is this better handled in separate issues?
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| file_scan_directory-1.patch | 49.95 KB | Idle | Passed: 9752 passes, 0 fails, 0 exceptions | View details | Re-test |

#1
#2
Committed to CVS HEAD. Thanks.
#3
Committed to CVS HEAD. Thanks.
#4
Uh wow, record commit time... we do need to document this in the upgrade instructions.
#5
I suggest the following for http://drupal.org/node/224333. I don't have permission to edit that page.
#6
Apparently I now have access to edit the page, so I did:
http://drupal.org/node/224333#file_scan_directory_property_names
#7
Automatically closed -- issue fixed for 2 weeks with no activity.