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.

CommentFileSizeAuthor
#4 see_also-D7.patch1.11 KBemmajane
#4 see_also-D6.patch1.12 KBemmajane
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Add related functions to the API documentation. » Add see also links to variable_set(), variable_get() and variable_del() to link them together
Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Other documentation issues » documentation

API 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!

jhodgdon’s picture

Issue tags: +Novice
emmajane’s picture

Assigned: Unassigned » emmajane
emmajane’s picture

Status: Active » Needs review
FileSize
1.12 KB
1.11 KB

Added 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. :)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

These patches for D6 and D7 both look good, apply cleanly.

webchick’s picture

Version: 7.x-dev » 6.x-dev

Oh, lord. Yes, please.

Committed to HEAD. Moving down to 6.x.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6 too, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.