It would be nice if the API documentation included a related functions section. For example, if I'm looking at variable_set() in the API documentation, then my natural inclination is to assume that the function to unset or remove variables is either variable_unset() or variable_remove(), but neither of these is correct. In fact, variable_del() is the correct one. So, if I saw a set of related functions on variable_set() (i.e. variable_get(), variable_del(), etc.), then that would have saved me 15-20 minutes of searching for the proper function to unset a variable.
Comment | File | Size | Author |
---|---|---|---|
#4 | see_also-D7.patch | 1.11 KB | emmajane |
#4 | see_also-D6.patch | 1.12 KB | emmajane |
Comments
Comment #1
jhodgdonAPI documentation issues need to be filed under project Drupal, component Documentation, because this documentation is embedded in the core Drupal code.
So, we do already have a way to indicate related functions in function documentation, with a @see tag in the function header doc (this creates a See Also section on api.drupal.org for the function).
Since the feature you requested already exists, I am going to make this issue into a request to add @see tags specifically on variable_set, variable_get, and variable_del to reference each other. I am guessing the request is for Drupal 6, but we should patch on Drupal 7 and then port the patch to Drupal 6.
If you have other functions you would like to suggest See Also tags for, please file a separate issue for each set of functions that you think should be linked.
Thanks!
Comment #2
jhodgdonComment #3
emmajane CreditAttribution: emmajane commentedComment #4
emmajane CreditAttribution: emmajane commentedAdded see also links. D7 and D6 patches included. I've included them on the same line and sorted by alpha. Please let me know if it should be otherwise. :)
Comment #5
jhodgdonThese patches for D6 and D7 both look good, apply cleanly.
Comment #6
webchickOh, lord. Yes, please.
Committed to HEAD. Moving down to 6.x.
Comment #7
Gábor HojtsyCommitted to Drupal 6 too, thanks.