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.
API page: http://api.drupal.org/api/drupal/includes--database.inc/function/db_set_...
Describe the problem you have found:
Comment | File | Size | Author |
---|---|---|---|
#12 | db_set_active_doc_issues-4598096-12.patch | 706 bytes | barbi |
#6 | db_set_active_doc_issues-4598096-6.patch | 705 bytes | barbi |
Comments
Comment #1
aquariumtap CreditAttribution: aquariumtap commented[my original message seems to have been lost by using "preview"... here it is below]
It's unclear what "name" is, or where it's defined.
The answer: by default, the variable $db_url in settings.php is a single connection string. When multiple databases are configured, those strings are placed inside of an array. The key to each value is the "name".
For example:
In the above sample from settings.php, the "name" would be either 'default' or 'thirdparty'.
Comment #2
jhodgdonThanks for reporting!
This is a d6-specific bug. In D7 it is documented more clearly (the parameter is called $key and it's documented what it's an array key to).
So we should say that $name is a key into the $db_url global variable from settings.php. Good project for a novice doc contributor...
Comment #3
jhodgdonIt would be great if the @return was fixed up too. non -> none, and needs to start with a capital letter.
Comment #4
jhodgdonJust marked
#725856: db_set_active() documentation fix . . .
as a duplicate of this issue. It's about the @return section.
Comment #5
barbi CreditAttribution: barbi commentedsub
Comment #6
barbi CreditAttribution: barbi commentedComment #7
jhodgdonClose!
+ * The name of the previously active database or FALSE if None was found.
I think this needs a comma before the or, and None should not be capitalized. Sorry if my note about capital letters above confused you -- I meant the @return description needs to start with a capital letter, not the word none. :)
Comment #8
aquariumtap CreditAttribution: aquariumtap commentedThank you, doc team! These little improvements make a big difference.
Comment #9
jhodgdonAnother report of confusion on this function - should verify this fixes their doc issue too:
#1184106: db_set_active doc issues
Comment #10
aquariumtap CreditAttribution: aquariumtap commented@jhodgdon, that links back to this same issue..
Comment #11
jhodgdonwhoops.
#1189212: Documentation problem with db_set_active
Comment #12
barbi CreditAttribution: barbi commentedComment #13
jhodgdonThat looks fine to me - thanks!
Comment #14
Gábor HojtsyThanks, committed.