Files: 
CommentFileSizeAuthor
#12 db_set_active_doc_issues-4598096-12.patch706 bytesbarbi
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es). View
#6 db_set_active_doc_issues-4598096-6.patch705 bytesbarbi
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es). View

Comments

aquariumtap’s picture

[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:

$db_url = array(
  'default' => 'mysql://username:password@localhost/drupal_database',
  'thirdparty' => 'mysql://username1:password1@localhost/other_database'
  );

In the above sample from settings.php, the "name" would be either 'default' or 'thirdparty'.

jhodgdon’s picture

Issue tags: +Novice

Thanks 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...

jhodgdon’s picture

Title: Documentation problem with db_set_active » db_set_active doc issues

It would be great if the @return was fixed up too. non -> none, and needs to start with a capital letter.

jhodgdon’s picture

Just marked
#725856: db_set_active() documentation fix . . .
as a duplicate of this issue. It's about the @return section.

barbi’s picture

sub

barbi’s picture

Assigned: Unassigned » barbi
Status: Active » Needs review
FileSize
705 bytes
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es). View
jhodgdon’s picture

Status: Needs review » Needs work

Close!

+ * 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. :)

aquariumtap’s picture

Thank you, doc team! These little improvements make a big difference.

jhodgdon’s picture

Another report of confusion on this function - should verify this fixes their doc issue too:
#1184106: db_set_active doc issues

aquariumtap’s picture

@jhodgdon, that links back to this same issue..

jhodgdon’s picture

barbi’s picture

Status: Needs work » Needs review
FileSize
706 bytes
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es). View
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That looks fine to me - thanks!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

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