There is no documentation about the $table parameter of db_table_exists() function.
It is a string, and the value should be the name of the database table.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Documentation problem with db_table_exists » db_table_exists() doc is incomplete
Issue tags: +Novice

Good catch! That's true for all three versions of db_table_exists() in Drupal 6. They're listed here:
http://api.drupal.org/api/search/6/db_table_exists

They are also missing @return sections, and their first lines are not starting with a verb in the right tense, so they all need a bit of clean-up.

Drupal 7 is fine.

Good project for a new doc contributor I think...

pkiraly’s picture

Hi,

is there a starting guide for new doc contributors?

jhodgdon’s picture

Yes, thanks for asking!
http://drupal.org/node/144223
That should get you started, and/or point you to additional help on: how to set up a development environment, check out Drupal from CVS, figure out where the doucumentation is that you want to fix, and make a patch.

If you need further help, please ping me on IRC
http://drupal.org/irc
I'm usually in #drupal-docs and #drupal-contribute

pkiraly’s picture

Status: Active » Needs review
FileSize
3.65 KB

I have created a patch for this problem. It covers both 3 files (includes/database.pgsql.inc, includes/database.mysql.inc, includes/database.mysqli.inc), which contains this problem. I also added documentation for the db_column_exists() function.

jhodgdon’s picture

Status: Needs review » Needs work

That's a good start, but it needs a little bit of work.

a) We have some standards about how to document functions:
http://drupal.org/node/1354

- Start with verb in 3rd person (checks vs. check).
- Blank line between @param and @return sections.
- @param descriptions and @return descriptions should end in "."

b) I think the return value for the column_exists functions is true/false based on whether the column exists, not the table?

pkiraly’s picture

Status: Needs work » Needs review
FileSize
3.67 KB

Hi Jennifer,

thanks for your comments. I modified the patch according to your suggestions, except the first one. I did not modify the descriptions, just add some parameteres and return values. All database files' function descriptions use "check" style verb instead of 3rd person formulation ("Lock a table.", "Unlock all locked tables.", "Prepare user input for use in a database query...." etc.). I guess it would be another issue.

Péter

Status: Needs review » Needs work

The last submitted patch, database-db_table_exists-documentation-986682.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

You are correct -- D6 doesn't follow the verb tense standards very well, and I guess it is OK to leave these as-is. Normally, when people are editing the doc for a particular function, I try to get them to bring the entire function doc up to standards, but this patch is OK as is, and adds some needed documentation.

Ignore the test failure above. This is a known problem with the testing system. The patch applies fine, and thanks for contributing!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

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

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