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 routine drupal_system_listing calls file_scan_directory, passing it a $key value. The latter lists possible keys as:
while the former indicates the possible keys as:
Should the former indicate possible keys as: uri, filename, and name, with uri the default?
Comment | File | Size | Author |
---|---|---|---|
#19 | 713028revised.patch | 3.99 KB | jhodgdon |
#14 | 713028-morefix.patch | 3.99 KB | jhodgdon |
#10 | 713028.patch | 1.53 KB | hefox |
#9 | 713028.patch | 1.53 KB | hefox |
#8 | 713028.patch | 1.53 KB | hefox |
Comments
Comment #1
solotandem CreditAttribution: solotandem commentedPatch file attached.
Comment #2
jhodgdonGood catch! This is a D7 change from D6.
Here's a new patch for the drupal_system_listing() doc also fixes a minor formatting problem.
Comment #3
jhodgdonComment #4
hefox CreditAttribution: hefox commentedPatch applies cleanly and makes sense.
For constituency sake should there be an example of profiles directory?
(If memory serves me right, that is where profiles store modules at least in d6).
Comment #5
jhodgdonAdding an example for the profile directory is a great idea... But rather than relying on your memory, take a look at the code: http://api.drupal.org/api/function/drupal_system_listing/7 :)
It looks like it will look in profiles/your_site_profile/modules, not profiles/profile/modules
Comment #6
hefox CreditAttribution: hefox commentedChanged to your_site_profile, which resulted in more line bumping.
Comment #7
hefox CreditAttribution: hefox commentedAdded a / to the end so matches with the others
Comment #8
hefox CreditAttribution: hefox commented...wrong patch /face palm
Second time this week!
Comment #9
hefox CreditAttribution: hefox commentedChanging to your_site_dir for modules and removing white space
Comment #10
hefox CreditAttribution: hefox commentedSwt, twice in a row. Wrong patch.
Comment #11
jhodgdonAssuming the test bot agrees, I like the patch in #10. Good work hefox!
Comment #12
webchickThanks! Committed to HEAD, since the old documentation is just wrong.
But this really feels like it also could use a general clean-up for readability; it took me at least 3 reads to understand what the heck this function returns. Could we maybe augment it with some @example hunks like in http://api.drupal.org/api/function/t?
Comment #13
jhodgdonOK.
Comment #14
jhodgdonHere's a patch with a more comprehensive rewrite of the function doc for drupal_system_listing().
Comment #15
mr.baileysThat is a *huge* improvement over the current documentation for drupal_system_listing...
One issue:
Should read: "Each element in the array is an object of file information..."
Powered by Dreditor.
Comment #16
jhodgdonNo, it returns an array of associatiave arrays.
Comment #17
mr.baileysHmmm... On a relatively fresh install, running:
gives me
And
drupal_system_listing()
basically merges the results from different calls tofile_scan_directory
, which returnsSo either I'm misunderstanding something (very well possible at this hour), or drupal_system_listing returns an associative array of objects, not an array of associative arrays.
Comment #18
jhodgdonMy mistake -- you read the doc better than I did. Thanks!
Comment #19
jhodgdonHere's a patch, fixing #15.
Comment #20
mr.baileysLooks good to me!
Comment #21
realityloop#19: 713028revised.patch queued for re-testing.
Comment #22
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.