API page: http://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/fu...
Enter a descriptive title (above) relating to taxonomy_vocabulary_get_names, then describe the problem you have found:
> An array of vocabulary ids, names, machine names, keyed by machine name.
It's an array, but each item of the array is an object.
$vocabulary_data = taxonomy_vocabulary_get_names();
debug($vocabulary_data);
// result:
array (
'tags' =>
stdClass::__set_state(array(
'name' => 'Tags',
'machine_name' => 'tags',
'vid' => '1',
)),
)
Comment | File | Size | Author |
---|---|---|---|
#15 | fix-taxonomy-get-names-doc-1504226-15.patch | 776 bytes | kim.pepper |
#13 | fix-taxonomy-get-names-doc-1504226-13.patch | 776 bytes | kim.pepper |
#10 | fix-taxonomy-get-names-doc-1504226-10.patch | 773 bytes | kim.pepper |
#8 | fix-taxonomy-get-names-doc-1504226-7.patch | 740 bytes | kim.pepper |
#6 | fix-taxonomy-get-names-doc-1504226-6.patch | 741 bytes | kim.pepper |
Comments
Comment #1
jhodgdonThanks for reporting this! Looks like a good novice project to fix the docs.
Comment #2
kim.pepperI have updated the documentation to better reflect the actual returned structure.
Comment #3
joachim CreditAttribution: joachim commentedSorry to nitpick... but elsewhere, a vocabulary object is a specific thing with a consistent structure. Here we have something different and specific to this function. So here we should say 'an array of data objects keyed by vocabulary machine name' or something similar.
1 days to next Drupal core point release.
Comment #4
kim.pepperUpdated docs as per #3
Comment #5
jhodgdonHm.
There are a few things that need to be fixed with this patch:
- No lines can be longer than 80 characters, see
http://drupal.org/node/1354#general
- I don't think I like the wording. I have never seen the wording "data objects" in docs that I can recall -- I mean, all objects represent data, so it seems silly. My suggestion would be:
An associative array of objects with information about taxonomy vocabularies. Each object has properties:
- And then the actual property names would be listed below using list syntax
http://drupal.org/node/1354#lists
which would give the actual property name and a description of what it is.
Comment #6
kim.pepperHi Jen,
You certainly have a way with words!
Please find attached the re-worded patch, with line lengths fixed.
Comment #7
kim.pepperComment #8
kim.pepperRemoved extra whitespace at the end of the first line.
Comment #9
joachim CreditAttribution: joachim commentedThat's looking great! Except we've lost the information about the array being keyed by machine name. Nearly there :D
Comment #10
kim.pepperDoh! Trying again.
Comment #11
joachim CreditAttribution: joachim commentedLooks good to me :)
Comment #12
jhodgdonThe list in this patch does not follow our list syntax guidelines:
http://drupal.org/node/1354#lists
(period at end, capital letter after :).
Also, "ID" means identifier, while "id" is a psychological term (ego, superego, id).
Comment #13
kim.pepperOK. Hopefully this is it...
I'm also interested to know if there is an automated tool for checking comment syntax??
Kim
Comment #14
jhodgdonThere is no automated tool for checking comment syntax, aside from the bare minimums covered by the Coder module, that I am aware of.
Anyway, this patch looks good, oh wait, "vocubulary" is not spelled correctly.
After we're done with this, should we file a separate issue to change the name of this function? With a name like "taxonomy_vocabulary_get_names()", you would think it would just return the names of the vocabs... :)
Comment #15
kim.pepperTypo fixed.
Comment #16
jhodgdonCommitted to 8.x, and 7.x thanks!